Is there a way to run a Powershell script from Keybreeze?
If I try this it doesn't work from Keybreeze but it does work from the Windows Run box.
powershell.exe C:\Powershell\AWS.ps1
I tried C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\Powershell\AWS.ps1 and that launched Powershell but it closed right away. The script has prompts and should wait for input from me. Pasting the comand into run still works with this.
Hi Brian,
Good to hear from you! I tried ecarr's suggestion with a test Powershell script, and the prompt appeared in my environment. The target of my keyword is:
C:\windows\system32\windowspowershell\v1.0\powershell.exe c:\test\test.ps1
The text of this Powershell script is:
$User = Read-Host -Prompt 'What is your name?'
Write-Host "You entered, '$User'"
When I run this from the Start > Run dialog box, I get the prompt, enter my name, and then it closes. When I run this from Keybreeze, I get the same behavior, which appears to be expected when running Powershell scripts from outside the console -- https://stackoverflow.com/questions/16739322/how-to-keep-the-shell-window-open-after-running-a-powershell-script.
I was able to keep the Powershell script window open by changing my target to the following.
C:\windows\system32\windowspowershell\v1.0\powershell.exe -NoExit "c:\test\test.ps1"
Let me know if the -NoExit switch works for your script.
Thanks,
Andrew
Use the full path where powershell.exe is located, then the path of the script.