And I should have notices your dump of the
Please attach a complete session log file.
Session.GetFiles
result.
Please attach a complete session log file.
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
Session.GetFiles
result.
TransferOperationResult.Check
.
try
{
# Load WinSCP .NET assembly
# Use "winscp.dll" for the releases before the latest beta version.
[Reflection.Assembly]::LoadFrom("\\C:\scripts\WinSCP.dll") | Out-Null
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::Sftp
$sessionOptions.HostName = "xxxxxxxx"
$sessionOptions.UserName = "xxxxxxxx"
$sessionOptions.Password = "xxxxxxxx"
$sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 0e:2b:76:24:bf:50:e7:29:f5:01:2b:e6:59:16:ea:10"
$session = New-Object WinSCP.Session
$session.AdditionalExecutableArguments = "/xmllog='c:\temp\lab_qc_log.xml'"
$session.DebugLogPath = "c:\temp\lab_qc_debug.log"
$session.SessionLogPath = "c:\temp\lab_qc_session.log"
$session.XmlLogPath = "c:\temp\lab_qc_sessionxml.xml"
$session.ExecutablePath = "c:\scripts\winscp.exe"
try
{
# Connect
$session.Open($sessionOptions)
$stamp = Get-Date -f "yyyyMMdd"
$fileDay = Get-Date -Format "dd"
$fileName = "FTP20*"
$remotePath = "/U/softprint/$fileName"
$localPath = "c:\lab_qc\$fileName"
$session.GetFiles($remotePath, $localpath)
}
catch [Exception]
{
Write-Host $_.Exception.Message
}
finally
{
# Disconnect, clean up
$session.Dispose()
}
exit 0
}
catch [Exception]
{
Write-Host $_.Exception.Message
exit 1
}