Using PowerShell to Unblock multiple files
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.
Dev branch on #vCheck has been updated to the new @VMwareClarity theme https://t.co/DBRCSm4jWI pic.twitter.com/6Nr4N4wwUJ
— Alan Renouf (@alanrenouf) October 7, 2017
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:
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
Now all the files within the C:\Scripts\vcheck-dev directory are Unblocked and the new vCheck Dev build looks amazing! :)