No Constructor for WinSCP.TransferResumeSupport
I was working with the [WinSCP.TransferOptions] Class, i wanted to set the .ResumeSupport property. I see that that property should be of Type WinSCP.TransferResumeSupport. Which has two properties, State and Threshold, so this was my goal:
However, for the first line i get the following error:
I know this can be done:
But i would like to be able to declare my TransferResumeSupport Object separately. Is there a reason there is no constructor for this object type?
$resumeSupport = New-Object -TypeName WinSCP.TransferResumeSupport $resumeSupport.State = 'On' $resumeSupport.Threshold = 1000 $transferOptions = New-Object -TypeName WinSCP.TransferOptions $transferOptions.ResumeSupport = $resumeSupport
However, for the first line i get the following error:
New-Object : A constructor was not found. Cannot find an appropriate constructor for type WinSCP.TransferResumeSupport.
I know this can be done:
$transferOptions = New-Object -TypeName WinSCP.TransferOptions $transferOptions.ResumeSupport.State = 'On' $transferOptions.ResumeSupport.Threshold = 1000