A PowerShell execution-policy error often tempts users to paste a global Bypass command from a forum. Microsoft describes execution policy as defense in depth, not a security boundary. A script can still be malicious when permitted, and changing policy does not make it trustworthy. The responsible process is to identify the script's origin, inspect its content and signature, determine the effective policy scope, and make the narrowest legitimate change only if the script belongs in the workflow.
Before you start
Keep a copy of the exact error message and the script file. Do not run a script from an email, chat or unknown repository solely to fix an unrelated Windows problem. On an organization-managed PC, Group Policy may override local changes. Have a restore point or backup for scripts that alter system state.Do it step by step
- Run Get-ExecutionPolicy -List in PowerShell and note the values for MachinePolicy, UserPolicy, Process, CurrentUser and LocalMachine. The effective policy follows scope precedence, not the last command typed.
- Identify the script's download URL, publisher and expected behavior. Open it as text and look for downloads, credential access, persistence or destructive file operations before execution.
- Check file properties and any Authenticode signature using Get-AuthenticodeSignature. A signature helps establish publisher integrity but does not by itself prove that the script's actions are safe.
- If the script is trusted but marked as downloaded, check the Zone.Identifier marker and Microsoft's Unblock-File guidance. Unblock only this reviewed file, not a whole directory of unknown scripts.
- If a legitimate workflow requires a policy change, prefer a bounded Process or CurrentUser scope consistent with organizational policy, and document why. Never disable MachinePolicy as a workaround.
- Run the script in the lowest privilege context that can perform its task, review output, and verify the intended files or settings changed. Return any temporary process setting by closing that session.