Sign in to follow this  
Followers 0
water

Analyzing COM objects

23 posts in this topic

#1 ·  Posted (edited)

Just for the records:
 
MS provides an easy method to retrieve the methods, properties, events of COM objects by using PowerShell.

  • Open powershell.
  • Create the object. The syntax is:
    $variable = New-object -ComObject "ProgID"
  • Type the variable name to retrieve the properties of the object
  • Use "Get-Member" to retrieve all properties, methods, collections and events of the object

Example: 

$IE = New-object -ComObject "InternetExplorer.Application"
$IE
$IE|Get-Member
PS> $object = New-Object -COMObject "InternetExplorer.Application"
PS> $object

Application          : System.__ComObject
Parent               : System.__ComObject
Container            :
Document             :
TopLevelContainer    : True
Type                 :
Left                 : 309
Top                  : 92
Width                : 1383
Height               : 870
LocationName         :
LocationURL          :
Busy                 : False
Name                 : Windows Internet Explorer
HWND                 : 2361028
FullName             : C:\Program Files\Internet Explorer\iexplore.exe
Path                 : C:\Program Files\Internet Explorer\
Visible              : False
StatusBar            : True
StatusText           :
ToolBar              : 1
MenuBar              : True
FullScreen           : False
ReadyState           : 0
Offline              : False
Silent               : False
RegisterAsBrowser    : False
RegisterAsDropTarget : True
TheaterMode          : False
AddressBar           : True
Resizable            : True

PS> $object|Get-Member

   TypeName: System.__ComObject#{d30c1661-cdaf-11d0-8a3e-00c04fc9e26e}

Name                 MemberType Definition
----                 ---------- ----------
ClientToWindow       Method     void ClientToWindow (int, int)
ExecWB               Method     void ExecWB (OLECMDID, OLECMDEXECOPT, Variant, Variant)
GetProperty          Method     Variant GetProperty (string)
GoBack               Method     void GoBack ()
GoForward            Method     void GoForward ()
GoHome               Method     void GoHome ()
GoSearch             Method     void GoSearch ()
Navigate             Method     void Navigate (string, Variant, Variant, Variant, Variant
Navigate2            Method     void Navigate2 (Variant, Variant, Variant, Variant, Varia
PutProperty          Method     void PutProperty (string, Variant)
QueryStatusWB        Method     OLECMDF QueryStatusWB (OLECMDID)
Quit                 Method     void Quit ()
Refresh              Method     void Refresh ()
Refresh2             Method     void Refresh2 (Variant)
ShowBrowserBar       Method     void ShowBrowserBar (Variant, Variant, Variant)
Stop                 Method     void Stop ()
AddressBar           Property   bool AddressBar () {get} {set}
Application          Property   IDispatch Application () {get}
Busy                 Property   bool Busy () {get}
Container            Property   IDispatch Container () {get}
Document             Property   IDispatch Document () {get}
FullName             Property   string FullName () {get}
FullScreen           Property   bool FullScreen () {get} {set}
Height               Property   int Height () {get} {set}
HWND                 Property   int64 HWND () {get}
Left                 Property   int Left () {get} {set}
LocationName         Property   string LocationName () {get}
LocationURL          Property   string LocationURL () {get}
MenuBar              Property   bool MenuBar () {get} {set}
Name                 Property   string Name () {get}
Offline              Property   bool Offline () {get} {set}
Parent               Property   IDispatch Parent () {get}
Path                 Property   string Path () {get}
ReadyState           Property   tagREADYSTATE ReadyState () {get}
RegisterAsBrowser    Property   bool RegisterAsBrowser () {get} {set}
RegisterAsDropTarget Property   bool RegisterAsDropTarget () {get} {set}
Resizable            Property   bool Resizable () {get} {set}
Silent               Property   bool Silent () {get} {set}
StatusBar            Property   bool StatusBar () {get} {set}
StatusText           Property   string StatusText () {get} {set}
TheaterMode          Property   bool TheaterMode () {get} {set}
ToolBar              Property   int ToolBar () {get} {set}
Top                  Property   int Top () {get} {set}
TopLevelContainer    Property   bool TopLevelContainer () {get}
Type                 Property   string Type () {get}
Visible              Property   bool Visible () {get} {set}
Width                Property   int Width () {get} {set}
Edited by water
2 people like this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites



That is pretty ace.

Windows PowerShell
Copyright © 2009 Microsoft Corporation. All rights reserved.
 
PS C:UsersJOHN> $SW = New-object -ComObject "ShockwaveFlash.ShockwaveFlash.11"
PS C:UsersJOHN> $SW
 
 
ReadyState                 : 0
TotalFrames                :
Playing                    : True
Quality                    : 1
ScaleMode                  : 0
AlignMode                  : 0
BackgroundColor            : -1
Loop                       : True
Movie                      :
FrameNum                   : -1
WMode                      : Window
SAlign                     :
Menu                       : True
Base                       :
Scale                      : ShowAll
DeviceFont                 : False
EmbedMovie                 : False
BGColor                    :
Quality2                   : High
SWRemote                   :
FlashVars                  :
AllowScriptAccess          :
MovieData                  :
InlineData                 :
SeamlessTabbing            : True
Profile                    : False
ProfileAddress             :
ProfilePort                : 0
AllowNetworking            : all
AllowFullScreen            : false
AllowFullScreenInteractive : false
IsDependent                : False
 
 
 
PS C:UsersJOHN> $SW|Get-Member
 
 
   TypeName: System.__ComObject#{d27cdb6c-ae6d-11cf-96b8-444553540000}
 
Name                       MemberType Definition
----                       ---------- ----------
Back                       Method     void Back ()
CallFunction               Method     string CallFunction (string)
CurrentFrame               Method     int CurrentFrame ()
DisableLocalSecurity       Method     void DisableLocalSecurity ()
EnforceLocalSecurity       Method     void EnforceLocalSecurity ()
FlashVersion               Method     int FlashVersion ()
Forward                    Method     void Forward ()
FrameLoaded                Method     bool FrameLoaded (int)
GetVariable                Method     string GetVariable (string)
GotoFrame                  Method     void GotoFrame (int)
IsPlaying                  Method     bool IsPlaying ()
LoadMovie                  Method     void LoadMovie (int, string)
Pan                        Method     void Pan (int, int, int)
PercentLoaded              Method     int PercentLoaded ()
Play                       Method     void Play ()
Rewind                     Method     void Rewind ()
SetReturnValue             Method     void SetReturnValue (string)
SetVariable                Method     void SetVariable (string, string)
SetZoomRect                Method     void SetZoomRect (int, int, int, int)
Stop                       Method     void Stop ()
StopPlay                   Method     void StopPlay ()
TCallFrame                 Method     void TCallFrame (string, int)
TCallLabel                 Method     void TCallLabel (string, string)
TCurrentFrame              Method     int TCurrentFrame (string)
TCurrentLabel              Method     string TCurrentLabel (string)
TGetProperty               Method     string TGetProperty (string, int)
TGetPropertyAsNumber       Method     double TGetPropertyAsNumber (string, int)
TGetPropertyNum            Method     double TGetPropertyNum (string, int)
TGotoFrame                 Method     void TGotoFrame (string, int)
TGotoLabel                 Method     void TGotoLabel (string, string)
TPlay                      Method     void TPlay (string)
TSetProperty               Method     void TSetProperty (string, int, string)
TSetPropertyNum            Method     void TSetPropertyNum (string, int, double)
TStopPlay                  Method     void TStopPlay (string)
Zoom                       Method     void Zoom (int)
AlignMode                  Property   int AlignMode () {get} {set}
AllowFullScreen            Property   string AllowFullScreen () {get} {set}
AllowFullScreenInteractive Property   string AllowFullScreenInteractive () {get} {set}
AllowNetworking            Property   string AllowNetworking () {get} {set}
AllowScriptAccess          Property   string AllowScriptAccess () {get} {set}
BackgroundColor            Property   int BackgroundColor () {get} {set}
Base                       Property   string Base () {get} {set}
BGColor                    Property   string BGColor () {get} {set}
DeviceFont                 Property   bool DeviceFont () {get} {set}
EmbedMovie                 Property   bool EmbedMovie () {get} {set}
FlashVars                  Property   string FlashVars () {get} {set}
FrameNum                   Property   int FrameNum () {get} {set}
InlineData                 Property   IUnknown InlineData () {get} {set}
IsDependent                Property   bool IsDependent () {get} {set}
Loop                       Property   bool Loop () {get} {set}
Menu                       Property   bool Menu () {get} {set}
Movie                      Property   string Movie () {get} {set}
MovieData                  Property   string MovieData () {get} {set}
Playing                    Property   bool Playing () {get} {set}
Profile                    Property   bool Profile () {get} {set}
ProfileAddress             Property   string ProfileAddress () {get} {set}
ProfilePort                Property   int ProfilePort () {get} {set}
Quality                    Property   int Quality () {get} {set}
Quality2                   Property   string Quality2 () {get} {set}
ReadyState                 Property   int ReadyState () {get}
SAlign                     Property   string SAlign () {get} {set}
Scale                      Property   string Scale () {get} {set}
ScaleMode                  Property   int ScaleMode () {get} {set}
SeamlessTabbing            Property   bool SeamlessTabbing () {get} {set}
SWRemote                   Property   string SWRemote () {get} {set}
TotalFrames                Property   int TotalFrames () {get}
WMode                      Property   string WMode () {get} {set}
 
 
PS C:UsersJOHN>


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

To be honest, it is something I found on the AHK forum ^_^

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Is it possible to use powershell via command line?

I tried doing it adding $IE = New-object -ComObject "InternetExplorer.Application" as an argument but get ..

"Invalid assignment expression. The left hand side of an assignment operator nee

ds to be something that can be assigned to like a variable or a property."

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

It is possible AFAIK. From the top of my head: Use '-command $IE = New-object -ComObject "InternetExplorer.Application"*


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

powershell -command "$IE = New-object -ComObject InternetExplorer.Application; $IE|Get-Member"

or

powershell -command "$IE = New-object -ComObject 'InternetExplorer.Application'; $IE|Get-Member"

work pretty well.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Yep, that's it, cheers.

$Read = ""

$iPid = Run(@SystemDir & '\WindowsPowerShell\v1.0\powershell.exe -Command $SW = New-object -ComObject  "Shell.Explorer.2"' & @CRLF & '$SW' & @CRLF & '$SW|Get-Member', "", @SW_HIDE, 0x2 + 0x4)

While ProcessExists("powershell.exe")
    $Read &= StdoutRead($iPid)
WEnd

ConsoleWrite($Read)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

A bit shorter:

$Read = ""

$iPid = Run(@SystemDir & '\WindowsPowerShell\v1.0\powershell.exe -Command $SW = New-object -ComObject "Shell.Explorer.2";$SW;$SW|Get-Member', "", @SW_HIDE, 0x2 + 0x4)

While ProcessExists("powershell.exe")
    $Read &= StdoutRead($iPid)
WEnd

ConsoleWrite($Read)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Shorter code...

$iPid = Run(@SystemDir & '\WindowsPowerShell\v1.0\powershell.exe -Command $SW = New-object -ComObject "Shell.Explorer.2";$SW;$SW|Get-Member', "", @SW_HIDE, 0x2 + 0x4)

While ProcessExists("powershell.exe")
WEnd

ConsoleWrite(StdoutRead($iPid))

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

I didn't have to install it on my Windows 7 machine.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
PowerShell 1.0
PowerShell 1.0 was released in 2006 for Windows XP SP2, Windows Server 2003 and Windows Vista. It is an optional component of Windows Server 2008.
 
PowerShell 2.0
Windows PowerShell ISE v2.0, an integrated development environment for PowerShell scripts
PowerShell 2.0 is integrated with Windows 7 and Windows Server 2008 R2 and is released for Windows XP with Service Pack 3, Windows Server 2003 with Service Pack 2, and Windows Vista with Service Pack 1.
PowerShell V2 includes changes to the scripting language and hosting API, in addition to including more than 240 new cmdlets.

 

From wikipedia^

Although I'm sure I only have powershell 1.0 on my win 7 pro 32.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Check the version by running the following command. Here are my results.

>powershell -command $PSVersionTable

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34209
BuildVersion                   6.2.9200.16481
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Mine are a little different.

Name Value
---- -----
CLRVersion 2.0.50727.5485
BuildVersion 6.1.7601.17514
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1

 

 

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

I'm running Windows 7 Service Pack 1.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I'm running 64 bit with the latest updates.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Good luck ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.18444
BuildVersion                   6.3.9600.16406
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

 

 

:)


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Jibberish
      By Jibberish
      Hi all,
      I need to read a log file into an array, but the log file is encoded as $FO_UTF16_BE_NOBOM (2048) = Use Unicode UTF16 Big Endian (without BOM) per FileGetEncoding (it returns 2048).
      I have searched how to convert these log files to UTF-8 and finally found a Powershell command. Since then I have been racking my brain trying to get the function to work. The command itself works from a Powerscript prompt:
      C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-Content C:\Logs\Myplayer_10-10-17-02-31.log | Set-Content -Encoding utf8 C:\Logs\Myplayer1.log This is my sandbox;
      #include <array.au3> #include <File.au3> Local $aArrayLogFile Local $sLogDir = "C:\Logs\" Local $sLogFile = "Myplayer_10-10-17-02-31.log" Local $sConvertedLog = "ConvertedLog.log" Local $sLogDirFile = $sLogDir&$sLogFile RunWait("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-Content "&$sLogDirFile&" | Set-Content -Encoding utf8 "&$sConvertedLog,$sLogDir) _FileReadToArray($sLogDirFile, $aArrayLogFile) _ArrayDisplay($aArrayLogFile) Also tried
      RunWait("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-Content "&$sLogDirFile&" | Set-Content -Encoding utf8 "&$sConvertedLog,$sLogDir) and
      ShellExecuteWait("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"," -Command Get-Content "&$sLogDirFile&" | Set-Content -Encoding utf8 "&$sConvertedLog,$sLogDir) Tried without -Command and a bunch of other parameters that were sprinkled throughout the internet from people trying to get this to work.
      Thanks
      Jibs
    • ur
      By ur
      I am maintaining all the reusable code in a separate file as library.au3.
      In that file I have referenced some dependent files using fileinstall, so that they will be extracted when necessary.
       
      Problem is, if I use a function in the library.au3 in another script which doesn't require this dependent file, as I am including the whole file using include tag, it is embedding that file also.
      Is there any way to exclude that.
       
    • david1337
      By david1337
      Hi guys,
      I need a little help here
      I have this simple Powershell script, that is able to set "sig.htm" as signature in OWA for the mail account specified.
      First part of the script just loads the Exchange snapin, since this is needed for the Get-Mailbox command.
      #Add Exchange 2010/2013 snapin if not already loaded in the PowerShell session if (!(Get-PSSnapin | where {$_.Name -eq "Microsoft.Exchange.Management.PowerShell.E2010"})) { try { Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction STOP } catch { #Snapin was not loaded Write-Warning $_.Exception.Message EXIT } . $env:ExchangeInstallPath\bin\RemoteExchange.ps1 Connect-ExchangeServer -auto -AllowClobber } $mailboxes = Get-Mailbox -Identity user@domain.com $mailboxes| foreach {$file= "sig.htm"; Set-MailboxMessageConfiguration -identity $_.alias -SignatureHtml "$(Get-Content -Path $file -ReadCount 0)"} What I want is for AutoIt to use Powershell.exe to run the script somehow. This way I would be able to use AutoIt variables and arrays together with the PS script.
       I guess the solution would be to run Powershell.exe with command line arguments?
      If that is not possible, maybe have the script stored as a "ps1" file, and interact with it that way? (not preferred)
    • tcox8
      By tcox8
      Hello,
      Currently I am running a script that calls a powershell script. To read the results of that I am reading StdOut. I am parsing things accordingly but unfortunately it doesn't parse correctly all the time and I end up missing parts of the string or other problems. My question then is, what is the best results for reading what is returned when running a powershell script or something similar?
    • WoodGrain
      By WoodGrain
      Hi guys,
      This is probably an obvious one, but I really don't use this command at all so am hoping you can spot my mistake.
      I'm running a powershell script on a schedule with the following script in a function, the function is being called in a loop, but the console process is not closing in the background and I end up with a bunch of console windows running in the background:
      Run(@comspec & ' /k PowerShell.exe -STA -NonInteractive -ExecutionPolicy ByPass -Command "& ''Z:\Powershell\365\GetNextDetails.ps1'' "', "", @SW_HIDE) Thanks!