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
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.