Differences
This shows you the differences between the selected revisions of the page.
2017-05-12 | 2017-10-04 | ||
script_downloading_when_done_file_exists (martin) | using variable expansion in strings in powershell (martin) | ||
Line 84: | Line 84: | ||
# Remove suffix | # Remove suffix | ||
$finalName = $transfer.Destination.SubString(0, $transfer.Destination.Length - $suffix.Length) | $finalName = $transfer.Destination.SubString(0, $transfer.Destination.Length - $suffix.Length) | ||
- | Write-Host ("Renaming uploaded file {0} to final name {1}" -f $transfer.Destination, $finalName) | + | Write-Host "Renaming uploaded file $($transfer.Destination) to final name $finalName" |
# Rename uploaded file to its final name | # Rename uploaded file to its final name | ||
$session.MoveFile($transfer.Destination, $finalName) | $session.MoveFile($transfer.Destination, $finalName) | ||
Line 99: | Line 99: | ||
catch [Exception] | catch [Exception] | ||
{ | { | ||
- | Write-Host ("Error: {0}" -f $_.Exception.Message) | + | Write-Host "Error: $($_.Exception.Message)" |
exit 1 | exit 1 | ||
} | } |