How to Safely Run a PowerShell Script
Without permanently disabling the protection against malicious scripts.
PowerShell blocks scripts (.ps1) by default, as a security measure — here's how to run one with confidence, without permanently disabling that protection.
First of all: do you trust the source?
Only run scripts from sources you know and trust — a .ps1 script can do practically anything on your system, just like a normal program.
Running one for a one-off case (recommended)
- PowerShell as administrator.
- Run:
Set-ExecutionPolicy -Scope Process RemoteSigned— this only affects this specific window, not permanently. - Run the script with its full path.
Why use "-Scope Process": it limits the change to the current PowerShell window — when you close it, the restriction returns to its original state automatically, without leaving your system permanently less protected.
Tip: avoid changing the execution policy permanently and globally "to stop seeing the warning" — the temporary per-window setting is just as fast and doesn't reduce your protection long-term.
Frequently asked questions
Is it safe to permanently disable the script restriction?
It's not advisable — it reduces a genuine protection against malicious scripts. The temporary per-window setting (-Scope Process) achieves the same thing without that long-term risk.
What happens if I run a script from an unknown source?
It can do practically anything on your system, just like a normal executable program — only run scripts from sources you fully trust.