PowerShell says "execution of scripts is disabled on this system."
If PowerShell says "execution of scripts is disabled on this system," it means that the PowerShell Execution Policy is set to a restricted level that prevents scripts from running. This is a security feature that is designed to prevent malicious scripts from running on your system.
We can set the policy for Current User as Bypass
by using any of the below PowerShell commands:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force
Unrestricted policy loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.
Whereas in Bypass policy, nothing is blocked and there are no warnings or prompts during script execution. Bypass ExecutionPolicy
is more relaxed than Unrestricted
.