Run Powershell script with Windows Application Aspect
Is it possible to run a Powershell script with the Windows Application Aspect?
I've tried the following without success.
Windows Application:
powershell.exe
or the full path
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Program arguments:
-ExecutionPolicy Bypass -File "\\fileserver\script1.ps1"
Powershell starts but does not run the script or give any error message.
Voted best answer
make a .cmd file with:
@@echo off
powershell.exe -ExecutionPolicy Bypass -File "\\fileserver\script1.ps1"
store the .cmd file somewhere and call the .cmd file (full path) from de windows application aspect. That should work, even though it's a workaround ...
Answers
Did you use quotes around the program arguments? If I remember correct those are needed.
Add new comment