WinSCP get confused by the
.xml extension. You have to use another one. The session log is not XML, it's a plain text file. Use for example
Still not sure why it is not logging, but I figured out the issue that I needed the log. Remote folder path is case sensitive. I'd like to get the logging working, but it can be prioritized lower.
FYI I just tried 5.7.7 still no luck (as well as the new 5.7.7 .NET dll). I know the code is executing, because at the end I do a send-mail and that comes through.
I'm not sure what I am doing wrong. I have a power script that uses the below code. It won't create the log file. The folder exists, and I have full rights to it. I can created and delete files there just fine. I am using 5.7.6
# Load WinSCP .NET assembly
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::ftp
$sessionOptions.HostName = "22.214.171.124"
$sessionOptions.UserName = "*****"
$sessionOptions.Password = "*****"
$session = New-Object WinSCP.Session
$session.SessionLogPath = "C:\WinSCPLogs\test.xml"