As per my previous post:
please post your new code and corresponding log file
please post your new code and corresponding log file
Protocol.Ftp
won't even compile.
[WinSCP.Protocol]::Ftp
is correct (lowercase ftp
is acceptable too).
Protocol = [WinSCP.Protocol]::ftp
, the log shows:
. 2024-05-02 08:44:27.298 Transfer Protocol: FTP
# Load the WinSCP .NET assembly
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"
# Initialize a new WinSCP session
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = Protocol.Ftp
HostName = "myftp.com" # Your remote host
UserName = "myname"
Password = "mypass"
}
Protocol = [WinSCP.Protocol]::ftp