I'm trying to load WinSCPnet.dll
file using below code in PowerShell, and I'm getting below error.
Set-Location "D:\WinSCP-5.17.10-Automation"
Add-Type -Path "WinSCPnet.dll"
Add-Type : Could not load file or assembly 'file:///D:\WinSCP-5.17.10-Automatio n\WinSCPnet.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
At line:2 char:9
+ Add-Type <<<< -Path "WinSCPnet.dll"
+ CategoryInfo : NotSpecified: (:) [Add-Type], BadImageFormatExce ption
+ FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerSh ell.Commands.AddTypeCommand
Is there any other way to add this assembly in PowerShell 2.0 and if it is not supported is there any WinSCPnet.dll
available, which supports PowerShell 2.0?