SOLVED

Powershell error: Could not load file or assembly

%3CLINGO-SUB%20id%3D%22lingo-sub-2089959%22%20slang%3D%22en-US%22%3EPowershell%20error%3A%20Could%20not%20load%20file%20or%20assembly%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2089959%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20install%20a%20solution%20from%20github%20and%20I%20get%20the%20error%3A%26nbsp%3B%3C%2FP%3E%3CP%3EImport-Module%20%3A%20Could%20not%20load%20file%20or%20assembly%20'file%3A%2F%2F%2FC%3A%5CUsers%5C...%5CSharePointPnPPowerShellOnline%5CSharePointPnP.PowerShell.Online.Commands.dll'%20or%20one%20of%20its%20dependencies.%20Operation%20is%20not%20supported.%20(Exception%20from%20HRESULT%3A%200x80131515)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20nows%20what%20I'm%20doing%20wrong%3F%20I%20have%20deleted%20som%20of%20the%20url%20there%2C%20because%20it%20has%20my%20name%20and%20the%20name%20of%20the%20solution%20in%20it.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2089959%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2092137%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20error%3A%20Could%20not%20load%20file%20or%20assembly%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2092137%22%20slang%3D%22en-US%22%3EJust%20to%20double%20check%2C%20have%20you%20installed%20PnP%20PowerShell%3F%20From%20the%20error%20message%2C%20it%20seems%20to%20be%20that%20is%20using%20the%20previous%20version%20of%20the%20module%20as%20well%20-%20a%20new%20version%20was%20released%20last%20week.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2092862%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20error%3A%20Could%20not%20load%20file%20or%20assembly%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2092862%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9907%22%20target%3D%22_blank%22%3E%40Joel%20Rodrigues%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20answering!%20Yes%2C%20I%20have%20the%20newest%20version%20of%20PnPPowerShell%20installed.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

I'm trying to install a solution from github and I get the error: 

Import-Module : Could not load file or assembly 'file:///C:\Users\...\SharePointPnPPowerShellOnline\SharePointPnP.PowerShell.Online.Commands.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

 

Anyone nows what I'm doing wrong? I have deleted som of the url there, because it has my name and the name of the solution in it. 

4 Replies
Just to double check, have you installed PnP PowerShell? From the error message, it seems to be that is using the previous version of the module as well - a new version was released last week.

Hi @Joel Rodrigues,

 

Thanks for answering! Yes, I have the newest version of PnPPowerShell installed. 

Hi @Tonje Waasjø 

 

In that case, I believe you will need the previous version for Windows PowerShell and not the new version for PowerShell Core.

 

Install-Module SharePointPnPPowerShellOnline

 

Documentation still seems to be available:

https://docs.microsoft.com/en-us/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets?view=sh...

best response confirmed by Tonje Waasjø (Contributor)
Solution

The problem is sloved. It was caused by the zip-file being blocked by your operating system. Sloved it by using 7Zip