Re: Download multiple files from an array
I re-wrote the function and was able to get it to work. Thanks Martin!
if ($RenameOnServer -eq $true) {
# If the file was downloaded successfully rename it but leave it on the server
$Session.MoveFile($FullDLFile, "$FullDLFile$RenameExtension")
}
Weekly_Values
file exists only (the first in the array), it is downloaded if only the Monthly_Values
file exists, nothing is downloaded.
Session.DebugLogPath
and attach the log.
GetFiles
for each file I'm trying to download. Can you please help me with my logic on this? Here is my code:
$GetFileMask = @("Weekly_Values*.pgp", "Monthly_Values*.pgp")
# Download the files according to the file mask
foreach ($file in $GetFileMask) {
# Download the file and throw on any error
$transferResult = $Session.GetFiles("$ServerPath$file", "$DLPATH$file")
$transferResult.Check();
}