For example, this PS1 script (save as "pause.ps1":
Code: Select all
write-host "Press any key to continue..."
[void][System.Console]::ReadKey($true)
Code: Select all
#SingleInstance force ; Skips the dialog box and replaces the old instance automatically
strPsScriptFile := A_ScriptDir . "\pause.ps1"
RunWait, PowerShell.exe -ExecutionPolicy Bypass -Command %strPsScriptFile%
return
Of course, I tried various combination of quoting, for example:
RunWait, PowerShell.exe -ExecutionPolicy Bypass -Command "%strPsScriptFile%"
RunWait, PowerShell.exe -ExecutionPolicy Bypass "-Command %strPsScriptFile%"
RunWait, PowerShell.exe "-ExecutionPolicy Bypass -Command %strPsScriptFile%"
But none worked. I also tried to encode the path (replace space with "%20"), without success.
Any help, please?