Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

PowerShell: Change the Execution Policy

📅 2011-Jul-30 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ powershell, security ⬩ 📚 Archive

By default, PowerShell will not execute any PowerShell script files. It will only execute the commands, cmdlets and aliases it ships with. This execution policy of PowerShell is called Restricted and is the default policy. Though this is secure, it is quite painful if you intend to write and use your own script files or PowerShell modules.

To change the execution policy to allow local scripts to execute, open a PowerShell with Administrator privileges and type:

Set-ExecutionPolicy RemoteSigned

The RemoteSigned policy will allow execution of all local scripts, but will require scripts on remote locations to be signed with a trusted certificate. The policy set using Set-ExecutionPolicy is applied for the current and all following PowerShell instances started by all users of the system.

Tried with: PowerShell 2.0

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧