Cannot Load Assembly in powershell
Hey everyone,
Ive downloaded the files and followed the directions to the best of my ability, but am having trouble loading the WinSCP.dll into my powershell application. I downloaded the portable package and the dll and put them in my pwd. Basically my structure looks like this:
.\Bin\My-PowershellScript.ps1
.\Bin\WinSCP.dll
.\Bin\WinSCP.com
.\Bin\WinSCP.exe
When I execute My-Powershell.ps1 out of the .\Bin directory and call the line
[Reflection.Assembly]::LoadFrom("Full Path to WinSCP.dll") and I get the following error.
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Users\PATH TO WinSCP.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT:
0x80131515)"
At C:\PATH TO My-PowershellScript.ps1.ps1:16 char:40
+ [System.Reflection.Assembly]::LoadFrom <<<< ("C:\Users\PATH TO WinSCP.dll") | Out-Null
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I've read the documentation over and again, and ive looked at all the other threads on loading .dlls into powershell and can't make any headway. Anybody have any ideas for help?
Ive downloaded the files and followed the directions to the best of my ability, but am having trouble loading the WinSCP.dll into my powershell application. I downloaded the portable package and the dll and put them in my pwd. Basically my structure looks like this:
.\Bin\My-PowershellScript.ps1
.\Bin\WinSCP.dll
.\Bin\WinSCP.com
.\Bin\WinSCP.exe
When I execute My-Powershell.ps1 out of the .\Bin directory and call the line
[Reflection.Assembly]::LoadFrom("Full Path to WinSCP.dll") and I get the following error.
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Users\PATH TO WinSCP.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT:
0x80131515)"
At C:\PATH TO My-PowershellScript.ps1.ps1:16 char:40
+ [System.Reflection.Assembly]::LoadFrom <<<< ("C:\Users\PATH TO WinSCP.dll") | Out-Null
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
I've read the documentation over and again, and ive looked at all the other threads on loading .dlls into powershell and can't make any headway. Anybody have any ideas for help?