Topic "PowerShell v4.0 Add-Type fails"

Author Message
[View user's profile]

Joined: 2016-05-31
Posts: 2
Location: Azusa, California
I had this working in PowerShell 2.0 but when I upgraded to v4 it started failing:
Add-Type -Path "WinSCPnet.dll"

This now returns the error:
Error: Could not load file or assembly 'file:///C:\APUDATA\WinSCPnet.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

I noticed that the upgrade to PowerShell v4 also required installing .NET Framework 4.5. I saw another post where you said you can't work with .NET 4.0, so is 4.5 also a problem? If so do you have a workaround?

Ray Martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
I do not think we ever said that the assembly does not work with .NET framework 4.0. It does.

Anyway, regarding your error, did you read this?
[View user's profile]

Joined: 2016-06-02
Posts: 1
Location: Saskatchewan
I ran into this as well.

Aside from the above tip about the dll protection, I had to run the command: "Enable-PSRemoting -Force" . I run in a secure environment so I recommend reading up on that command before using (if so required).

[View user's profile]

Joined: 2016-05-31
Posts: 2
Location: Azusa, California
Removing the Windows file attribute that blocks downloaded Internet files did the trick. Thank you very much!

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License