PowerShell execution policy doesn’t allow to run scripts. It is a safety feature that controls the conditions under which PowerShell loads configuration files and runs scripts to prevent the execution of malicious scripts. On a Windows computer you can set an execution policy for the current user, or for a particular session. or use a Group Policy setting to set execution policies for computers and users. To enable the options this are the steps you can follow:
- Open a PowerShell as an administrator
- Command for checking the current execution policy. If you dont set any policy before you will get ‘Restricted’.
3. Run below command to remove restriction for current user
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser