This project has moved and is read-only. For the latest updates, please go here.

Can't load file or assembly


When I run Import-Module Gac, I get this error message

PS C:\windows\system32> Import-Module Gac
Import-Module : Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\Gac\PowerShellGac.dll' or one of its dependencies. Operation
is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
  • Import-Module Gac
  • ~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
    • FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
I am running Powershell 4. Would you know what the issue is?


LTruijens wrote Aug 16, 2014 at 12:14 PM

You probably did not unblock the zip file after downloading. Please unblock the zip file before extracting or unblock all extracted files. You can read more about unblocking in the documentation. I hope this solves your problem.

fourpastmidnight wrote Apr 10, 2015 at 7:23 PM

If you extracted the zip file before unblocking, you will then need to unblock all the files extracted from the zip archive. As of PowerShell 3.0, there's an Unblock-File cmdlet that will let you do this from PowerShell.