I encountered the following error after executing a script in Powershell.
The reason for this error is because the Execution Policy is set to Restricted by default. We have to change it to prevent this error by running the script below.
PS C:\> Set-ExecutionPolicy RemoteSigned
Verify the change.
PS C:\> get-executionpolicy
You can also run the script below to bypass the policy.
c:\> powershell -ExecutionPolicy ByPass -File script.ps1
Cheers!
Leave a Reply