SOLVED

Powershell error: Could not load file or assembly

Brass 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. 

5 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ø (Brass Contributor)
Solution

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

I had the same error for a different DLL though from AWS SDKs. The file was present and I had to go to the file properties and on the general tab at the bottom it showed that the file was blocked because of the source and there was an option to unblock it. I had to do this for multiple files and it was sorted
1 best response

Accepted Solutions
best response confirmed by Tonje Waasjø (Brass Contributor)
Solution

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

View solution in original post