- We can use the Set-ExecutionPolicy cmdlet to change the execution policy of PowerShell on Windows computers. The changes done by you are affected immediately. You don’t require to restart the PowerShell Window.
- If you made some changes in the execution policy for the
- scope CurrentUser and LocalMachine, the changes are saved in the registry, and they remain effective until you change them again.
- If you make changes in the execution policy for the Process scope, then they are not saved in the registry.
- The following block describes you a syntax which is used to change the execution policy:
- Set-ExecutionPolicy -ExecutionPolicy <PolicyName>
Remove the ExecutionPolicy
We can remove the execution policy for a particular scope by setting the execution policy to Undefined.
Example: This example removes the execution policy for all the users of the local computer.
- Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope LocalMachine
Leave a Reply