Using PowerShell to Unblock multiple files

powershell blocked file

If you’ve ever downloaded a PowerShell script from the internet and tried running it you’ve probably seen the warning message “Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer.

In my case I noticed the following tweet from Alan Renouf about the vCheck dev branch.

Of course I had to check it out and after downloading it and trying to run it I got the message from above. Right clicking on the .ps1 files and looking at the properties also shows security message and a checkbox to Unblock the file:

powershell file properties

Checking the box manually works fine when it’s just a file or two, but in the case of something larger like vCheck where there are dozens of files it can become a pain. Luckily there is a quick and easy way to fix this… using PowerShell of course! 😉

How to Unblock files downloaded from the internet

Simply open Powershell and type the following:

dir -Path [directory path] -Recurse | Unblock-File

powershell unblock file example

Now all the files within the C:\Scripts\vcheck-dev directory are Unblocked and the new vCheck Dev build looks amazing! 🙂