SessionLogPath
is a property, not a method. So do:
$sessionOptions.SessionLogPath = ...
See https://winscp.net/eng/docs/library_session
SessionLogPath
is a property, not a method. So do:
$sessionOptions.SessionLogPath = ...
in englishFehler beim Aufrufen der Methode, da [WinSCP.Session] keine Methode mit dem Namen "SessionLogPath" enthält.
error by use the method because [winscp.session] no method with name "SessionLogPath"
try
{
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::$protocol
$sessionOptions.HostName = $hostname
$sessionOptions.UserName = $username
$sessionOptions.Password = $password
$session = New-Object WinSCP.Session
try
{
# Will continuously report progress of synchronization
$Session.SessionLogPath({c:\src\C:\src\Scripts\TEST\log.txt})
$session.add_FileTransferred( { FileTransferred } )
# Connect
$session.Open($sessionOptions)
$session.RemoveFiles("/test/*")
$synchronizationResult = $session.SynchronizeDirectories(
[WinSCP.SynchronizationMode]::Remote, $source, $target, $false)
.
.
.
.
.
.
Session.SessionLogPath
and attach the log.
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::$protocol
$sessionOptions.HostName = $hostname
$sessionOptions.UserName = $username
$sessionOptions.Password = $password
$session = New-Object WinSCP.Session
try
{
# Will continuously report progress of synchronization
$session.add_FileTransferred( { FileTransferred } )
# Connect
$session.Open($sessionOptions)
$session.RemoveFiles("/test/*")
{WinSCP.SessionRemoteException: Can't get attributes of file
$session.RemoveFiles("/path/*")
?