Log File not being created
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 = "65.82.131.58"
$sessionOptions.UserName = "*****"
$sessionOptions.Password = "*****"
$session = New-Object WinSCP.Session
$session.SessionLogPath = "C:\WinSCPLogs\test.xml"
try
{
# Connect
$session.Open($sessionOptions)
# 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 = "65.82.131.58"
$sessionOptions.UserName = "*****"
$sessionOptions.Password = "*****"
$session = New-Object WinSCP.Session
$session.SessionLogPath = "C:\WinSCPLogs\test.xml"
try
{
# Connect
$session.Open($sessionOptions)