Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Update: I found I am getting the following error.

The member "SessionLogPath" was not found for the specified .NET object.

Does anyone know the correct member for Session logging using the .Net object?

Session Logging not working in power shell script

I've tried everything to get Session Logging to work in this script. Does anyone have any idea's a can try. Below is the script I'm using.

# Load WinSCP .NET assembly
[Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\WinSCP\WinSCPnet.dll") | Out-Null

# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
$sessionOptions.HostName = ""
$sessionOptions.UserName = "User"
$sessionOptions.Password = "SomePassword"
$sessionOptions.SshHostKeyFingerprint = "xxxxxxxxxxxxxx"
$sessionOptions.SessionLogPath = "C:\Logs\SessionLogs\sessionlog.txt"

$session = New-Object WinSCP.Session


$session.PutFiles($DailyFileInfo.FullName, $RemoteDailyPath).Check()