Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 613 Bytes

powershell.md

File metadata and controls

19 lines (14 loc) · 613 Bytes

PowerShell: allow unsigned ps1 script to run

Fun fact: enabling Windows 10 Developer Mode turns this on by default.

Current user only

> Set-ExecutionPolicy -Scope CurrentUser Unrestricted
> path\to\foo.ps1
# opt.: set it back
> Set-ExecutionPolicy -Scope CurrentUser Default

When in doubt, use --force

  • run PowerShell as Administrator # Set-ExecutionPolicy Unrestricted
  • user PowerShell: > path\to\foo.ps1
  • (opt.) reset policy in admin shell: # Set-ExecutionPolicy Restricted