Add-Type : Could not load file or assembly [Resolved]

Advertisement

ibqadamani
Joined:
Posts:
2

Add-Type : Could not load file or assembly [Resolved]

Hi folks,

I have been trying for and looking through the forum threads for a solution but I keep getting the same issue.
I am trying to get Add-Type in PowerShell to work:
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"

but I get:
Add-Type : Could not load file or assembly 'file:///C:\Program Files (x86)\WinSCP\WinSCPnet.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
I unblocked the dll but I am still getting the same issue. I tried this also:
$assemblyPath = if ($env:WINSCP_PATH) { $env:WINSCP_PATH } else { $PSScriptRoot }
Add-Type -Path (Join-Path $assemblyPath "WinSCPnet.dll")

Specifications:
Windows 10
WinSCP-5.17.5
.NET Framework 4.7.3056
PowerShell version 5.1.17134.858

Last edited by ibqadamani on 2020-05-05 16:34; edited 1 time in total

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum