Differences
This shows you the differences between the selected revisions of the page.
library_example_zip_and_upload 2021-11-05 | library_example_zip_and_upload 2024-05-27 (current) | ||
Line 12: | Line 12: | ||
<code> | <code> | ||
- | powershell.exe -File "ZipUpload.ps1" -sessionUrl "sftp://username:password;fingerprint=ssh-rsa-xxxxxxxxxxx...=@example.com/" -remotePath "/remote/path" -archiveName "archive.zip" file1.dat file2.dat | + | powershell.exe -File "ZipUpload.ps1" -sessionUrl "sftp://username:password;fingerprint=ssh-rsa-xxxxxxxxxxx...@example.com/" -remotePath "/remote/path" -archiveName "archive.zip" file1.dat file2.dat |
</code> | </code> | ||
Line 25: | Line 25: | ||
# @description Packs the selected files to a ZIP archive and uploads it | # @description Packs the selected files to a ZIP archive and uploads it | ||
# @flag ApplyToDirectories | # @flag ApplyToDirectories | ||
- | # @version 9 | + | # @version 10 |
# @homepage ~~SELF~~ | # @homepage ~~SELF~~ | ||
# @require WinSCP 5.16 | # @require WinSCP 5.16 | ||
Line 42: | Line 42: | ||
param ( | param ( | ||
# Use Generate Session URL function to obtain a value for -sessionUrl parameter. | # Use Generate Session URL function to obtain a value for -sessionUrl parameter. | ||
- | $sessionUrl = "sftp://user:mypassword;fingerprint=ssh-rsa-xxxxxxxxxxx...=@example.com/", | + | $sessionUrl = "sftp://user:mypassword;fingerprint=ssh-rsa-xxxxxxxxxxx...@example.com/", |
[Parameter(Mandatory = $True)] | [Parameter(Mandatory = $True)] | ||
$remotePath, | $remotePath, | ||
Line 164: | Line 164: | ||
# Refresh the remote directory in WinSCP GUI, if -refresh switch was used | # Refresh the remote directory in WinSCP GUI, if -refresh switch was used | ||
- | if ($refresh -and $needRefresh) | + | if ($refresh) |
{ | { | ||
Write-Host "Reloading remote directory..." | Write-Host "Reloading remote directory..." |