Skip to content
⌘ NSIS Forum Archive

run powershell script from nsis

5 posts

shekara#

run powershell script from nsis

I am running into an issue when I try to execute a powershell script through nsis. I get the error code 196608. when I google on this, they say it is because I have set execution policy as bypass and not RemoteSigned. the solution google recommends is to set execution policy as RemoteSigned. when I set this in nsis, it still throws an error. I have tried this.
#ExecWait "powershell.exe -ExecutionPolicy RemoteSigned -WindowStyle Hidden -File '$TEMP\PS.ps1'" $0
#ExecWait 'powershell.exe "& "$TEMP\PS.ps1"' $0
#ExecWait "powershell -inputformat none -ExecutionPolicy RemoteSigned -File '$TEMP\PS.ps1'" $0

I cannot set RemoteSigned as it is a req. any help like always is appriciated
stass#
With the specified syntax (Space, after double quotes !) , the script is performed normally :

ClearErrors
nsExec::ExecToStack 'powershell -inputformat none -ExecutionPolicy RemoteSigned -File ""$EXEDIR\MyPs.ps1"" '
Pop $0