January 10th, 2015

PowerTip: Use PowerShell to Unblock Files in Folder

Doctor Scripto
Scripter

Summary: Learn how to use Windows PowerShell to unblock files downloaded from the Internet.

Hey, Scripting Guy! Question I downloaded a module from the Script Center Repository, and when I expanded and copied the files to
           my modules folder, I forgot to unblock them. Now every time I start Windows PowerShell, I get error
           messages and the modules don’t work. How can I easily fix this situation?

Hey, Scripting Guy! Answer Use the Get-ChildItem cmdlet to return a list of all files in your modules directory, and pipe them to
           the Unblock-File cmdlet, for example:

Get-ChildItem -Path 'C:\Program Files\WindowsPowerShell\Modules\' -Recurse | Unblock-File

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.

Feedback