Loading...

Powershell Tip : Run a ps1 without changing the executionpolicy rules


In order to run a powershell script (.ps1) on a computer, you have to change the executionpolicy rules. 


To see which policy is applied on your computer you type " set-executionpolicy " on the powershell prompt.

By default this policy is set to " Restricted ".


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"

Scripting 1810637861170527529

Enregistrer un commentaire

Accueil item

Award

Join me soon

Join me soon

Endpoint Manager award

Mes articles en français

Author of Books

PowerShell GUI & WPF Group

PowerShell GUI & WPF Group

Join the FPSUGR

Join the FPSUGR

Stats