Hello,
i get this error, a have installed SDK (online, 2013). Please help.
Add-Type : Could not load file or assembly 'file:///D:\Install\SharePoint Online Client Browser v2.2\Microsoft.SharePoi
nt.Client.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At C:\Users\jirka\AppData\Local\Temp\SPCB_PowerShell_OpenSite.ps1:24 char:9
+ Add-Type -Path (Resolve-Path $assemblyName)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-Type], FileLoadException
+ FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddTypeCommand
Comments: ** Comment from web user: robinbreman **
I get the same bug, but debugged the script you mentioned.
When i change the Load-Assembly function to first check the 16\isap folder for installed assemblies the script works.
```
function Load-Assembly([string]$assemblyName, [string]$sdkVersion) {
$isapiPath = "$($env:CommonProgramFiles)\Microsoft Shared\Web Server Extensions\16\ISAPI"
Write-Host $isapiPath - $assemblyName - $sdkVersion
if (Test-Path "$isapiPath\$assemblyName") {
Add-Type -Path "$isapiPath\$assemblyName"
}
elseif (Test-Path $assemblyName) {
Add-Type -Path (Resolve-Path $assemblyName)
}
else {
[System.Reflection.Assembly]::LoadWithPartialName($assemblyName)
}
}
```
Now powershell will connect!