Powershell Tip : Run a ps1 without changing the executionpolicy rules
https://www.systanddeploy.com/2014/07/powershell-run-ps1-without-changing.html?m=1
To see which policy is applied on your computer you type " set-executionpolicy " on the powershell prompt.
If you want to change it you have to type " set-executionpolicy remotesigned ", as an example.
To avoid changing this policy, you can run your ps1 using the below commandline.
c:\Windows\system32\WindowsPowershell\v1.0\powershell.exe -stan -WindowStyle Hidden -noprofile -executionpolicy bypass -file "name of your ps1file.ps1"
Enregistrer un commentaire