0

Set Execution Policy in Powershell

Powershell doesn’t allow scripts to be ran by default so the policy must be changed if you were to use any script. If you want to Set Execution Policy in Powershell or just simply check what it is, open up Powershell and run the following command:

PS C:\> Get-ExecutionPolicy
Restricted

If you’ve never set your execution policy this is what you will be seeing.  Now in order to change this to allow scripts you create locally, we’ll need to set it to RemoteSigned (or AllSigned, if you only want to run Signed Scripts). Since we don’t have any SSL Certificates on hand, I’m going to set my execution policy to remote signed.

Set Execution Policy in Powershell

To do this run Powershell as administrator and type in the following command:

PS C:\> Set-ExecutionPolicy RemoteSigned
Powershell Execution Policy

Note: You only have to set the execution policy once if you select Yes to All.

Press A to apply it to all.  If you want to learn a little more about execution policy.  Feel free to check out the MS Documentation.

That’s it!!

5/5 - (9 votes)

Paul Contreras

Hi, my name is Paul and I am a Sysadmin who enjoys working on various technologies from Microsoft, VMWare, Cisco and many others. Join me as I document my trials and tribulations of the daily grind of System Administration.

Leave a Reply

Your email address will not be published.