Deploy powershell ps1 script

Hello everyone,

I need to run a ps1 script already copied on a server folder, what are the right commands to insert into the Action Script?

This example does not work:
//executes powershell
waithidden cmd.exe /c powershell.exe -ExecutionPolicy Bypass -file “c:\users\public\install.ps1”

Regards

Generally your syntax should work, but you might need to disable wow64 redirection. I’d also suggest saving the output to a log file so you can see whether there is an error message. Try

action used wow64 redirection false

waithidden cmd.exe /c "powershell.exe -ExecutionPolicy Bypass -file "c:\users\public\install.ps1" > c:\windows\temp\output.txt 2>&1"
1 Like

Hello,
are you sure about this syntiax?

c:\windows\temp\output txt 2>&1

tks

I suspect that Jason left out a period symbol between output and txt.

It should be C:\windows\temp\output.txt 2>&1

2 Likes

Correct, I left out the period symbol. I’ve fixed it above, thanks!

1 Like