Steps to enable PowerShell script execution:
Open PowerShell as Administrator:
- Click Start, type
PowerShell
- Right-click Windows PowerShell and select Run as administrator
Check current execution policy:
Get-ExecutionPolicy
Set the execution policy to allow scripts:
Common choices:
RemoteSigned
— Allows running local scripts and scripts signed by a trusted publisher.Unrestricted
— Allows running all scripts.
Example to set to RemoteSigned (Recommended):
Set-ExecutionPolicy RemoteSigned