On Windows, the command for a temporary Unrestricted policy is Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted. Decide whether that policy is necessary before changing it: command-not-found errors usually have a different cause.

Inspect the effective policy

Get-ExecutionPolicy
Get-ExecutionPolicy -List

Execution policy controls how PowerShell handles scripts; it is not a complete security boundary. Organization Group Policy settings can override a local scope.

Prefer the narrowest change that fits

For locally written scripts, a less permissive session setting may be sufficient:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned

If a reviewed workflow specifically requires Unrestricted for this session:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted

Read the confirmation before accepting. Process scope ends with that PowerShell session and does not change the machine-wide policy. Unrestricted may still warn for files originating on the internet. Do not use it to evade organization policy or to run an unreviewed download.

Keep the diagnosis separate

If your message says a command is not recognized, first check spelling, modules and script paths. If the issue is a closing window, use an existing terminal or -NoExit instead. On macOS and Linux, execution policy is not enforced in the same Windows manner; these Windows policy changes are not the appropriate fix.

Sources and verification

Policy behavior checked against Microsoft documentation. No execution policy was changed during verification.