PowerShell is configured to prevent the execution of PowerShell scripts on Windows systems by default. In order to run commands, one of the following systems must be taken into consideration. See how to Set Execution Policy via PowerShell, and “How to Set Execution Policy via Windows Settings“.
To do this, open the Registry editor.
– To change the execution policy for the current user, go to
Set the string value ExecutionPolicy to one of the following values:
To change the execution policy for the LocalMachine scope, Navigate to the path as shown below.
Currently, no value is set and none is currently available. To set the string value ExecutionPolicy to one of the following values: Create a new string and enter any ExecutionPolicy value you desire as below. Restricted, AllSigned, RemoteSigned, Unrestricted, Undefined.
Create a new string and name it ExecutionPolicy
– Now enter the desired value.
Press okay afterwards and that is all.
I hope you found this blog post helpful. If you have any questions, please let me know in the comment session.