New-Object : The member "Speed" was not found for the specified .NET object.

Advertisement

Stealthmatt
Guest

New-Object : The member "Speed" was not found for the specified .NET object.

I used the latest version to create a powershell code output, and then downloaded the latest version of the .net library.

Now when I run it, I get this error

New-Object : The member "Speed" was not found for the specified .NET object.

try
{
# Connect
$session.Open($sessionOptions)

# Set up transfer options
$transferOptions = New-Object WinSCP.TransferOptions -Property @{
Speed = 8192
}

# Transfer files
$session.PutFiles("E:\SQL_Server_Backups\file.rar", "/RAR/*", $False, $transferOptions).Check()

Reply with quote

Advertisement

Stealthmatt
Guest

Looks like its generating the code with "Speed" instead of "SpeedLimit"

TypeName: WinSCP.TransferOptions
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
FileMask Property string FileMask {get;set;}
FilePermissions Property WinSCP.FilePermissions FilePermissions {get;set;}
OverwriteMode Property WinSCP.OverwriteMode OverwriteMode {get;set;}
PreserveTimestamp Property bool PreserveTimestamp {get;set;}
ResumeSupport Property WinSCP.TransferResumeSupport ResumeSupport {get;set;}
SpeedLimit Property int SpeedLimit {get;set;}
TransferMode Property WinSCP.TransferMode TransferMode {get;set;}

Reply with quote

Advertisement

You can post new topics in this forum