Run Downloaded PowerShell Scripts

If you downloaded a PowerShell scripts, for example as part of a .zip file, you may see the message

[Script name] is not digitally signed. The script will not execute on the system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.

This happens even if you follow the suggestion in my earlier post to

Set-ExecutionPolicy RemoteSigned

What gives?

Long story short, as explained under about_Execution_Policies, RemoteSigned will let you execute scripts that you create and save locally, but if you downloaded a script, it must be digitally signed to run. There are more details in this Information Security answer and this TechNet blog post.

You can, of course, change the Set-ExecutionPolicy to be less restrictive, but to unblock one unsigned file at a time, simply locate it in Windows Explorer, right-click, select Properties, and click on the Unblock button. This removes the Zone.Identifier alternate data stream, basically making the computer forget that this file was downloaded from the Internet.

PowerShell security

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.