I have a powershell script where I load some sharepoint assemblies. It works on my machine but when I zip it up with the dlls and send it to my friend. He puts the dlls in the correct place and then runs the script and we get this error:
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
Could not load file or assembly '<file:///C:\Program Files\Common Files\Microsoft>
Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll' or one o
f its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131
515)
We have the same version of powershell
add the dlls like so
Try{
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll'
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll'
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Publishing.dll'
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll'
}
catch {
Write-Host $_.Exception.Message
Write-Host "No further parts of the migration will be completed, The script will now exit"
Exit
}