This project has moved. For the latest updates, please go here.
1
Vote

Can't load file or assembly

description

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?

comments

LTruijens wrote Aug 16, 2014 at 11:14 AM

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 6: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.