Author Posts

June 3, 2018 at 9:27 am

Vous

hi
i use a powershell script with a scheduled task
the script is in this folder

C:\Program Files\xxx\etc\apps\xxx\bin\pingstatus.ps1
i have to modify automatically the execution policy (Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy UnRestricted) in the script
i dont success to code this
could you help me please???
regards

June 3, 2018 at 11:58 am

Please take a close look to the help for the Powershell.exe.

Powershell.exe /?

Especially to the parameter -ExecutionPolicy!!
You cannote change the policy to be able to run scripts from inside a script. That's somewhat like the chicken and egg dilemma.