Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

StdoutRead a Powershell window.

$
0
0

I have a script that executes powershell commands to interact with Office 365(Microsoft hosted Exchange service).

 

I want to hide the powershell window and interpret the output silently, so that non-savvy users can reset passwords and such without having to learn powershell or understand its errors.

 

However, when I use:

Func RunCommand($commandtorun)     $output = ""     If WinExists("Administrator:") Then WinActivate("Administrator:")     Send($commandtorun & "{ENTER}")     While 1         $output &= StdoutRead($pwshell)         If @error Then ExitLoop     WEnd     MsgBox(0, "stdoutread", $output) EndFunc   ;==>RunCommand

It doesn't exit the loop until I close the powershell window.(by design I believe)

 

Is there another way to return just a particular command's output?

 

Also, if I use $Stdin_child, the powershell window doesn't display its prompt for a command until I close my script.

Is that by design also?


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>