Currently Owner/Director of Optimization @okay_marketing

Close Notification

All posts in: Powershell

Run only scripts that you trust. Disable Powershell Message

This article can also be read at my new website: http://www.theitbros.com.

If you are like me you have probably run into the following error when trying to run powershell scripts. This becomes very annoying and tedious if you are running different scripts on a regular basis.

“Security Warning – Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your computer. Do you want to run –.ps1? [D] Do not run [R] Run once [S] Suspend [?] Help (default is “D”):

Step #1

The first thing you need to do is launch Windows Powershell.

Step #2

Then enter the following commands:

get-executionpolicy

set-executionpolicy bypass

Powershell Trust Scripts

Powershell Trust Scripts

Now launch your script and enjoy not seeing that annoying message come up.

powershell-script

Vista Powershell Script fix

Step #1

Go to Run and type regedit

Step #2

HKEY_Local_Machine\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellIds\\Microsoft.Powershell\\ExecutionPolicy

Step #3

In that registry key, change value to Unrestricted.

Buy Windows Vista