Differences
This shows you the differences between the selected revisions of the page.
2021-11-05 | 2021-11-05 | ||
old revision restored – the fix breaks other scenarios, final fix coming (martin) | make refresh optional (martin) | ||
Line 20: | Line 20: | ||
# @name &ZIP and Upload... | # @name &ZIP and Upload... | ||
# @command powershell.exe -ExecutionPolicy Bypass -File "%EXTENSION_PATH%" ^ | # @command powershell.exe -ExecutionPolicy Bypass -File "%EXTENSION_PATH%" ^ | ||
- | # -sessionUrl "!E" -remotePath "!/" -archiveName "%ArchiveName%" -pause ^ | + | # -sessionUrl "!E" -remotePath "!/" -archiveName "%ArchiveName%" ^ |
- | # -sessionLogPath "%SessionLogPath%" %Use7zip% -path7zip "%Path7zip%" ^ | + | # -refresh -pause -sessionLogPath "%SessionLogPath%" ^ |
- | # -archive7zip %Archive7zip% !& | + | # %Use7zip% -path7zip "%Path7zip%" -archive7zip %Archive7zip% !& |
# @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 7 | + | # @version 8 |
# @homepage ~~SELF~~ | # @homepage ~~SELF~~ | ||
# @require WinSCP 5.16 | # @require WinSCP 5.16 | ||
Line 47: | Line 47: | ||
[Switch] | [Switch] | ||
$pause, | $pause, | ||
+ | [Switch] | ||
+ | $refresh, | ||
[Switch] | [Switch] | ||
$use7Zip, | $use7Zip, | ||
Line 157: | Line 159: | ||
Write-Host "Archive $archiveName uploaded." | Write-Host "Archive $archiveName uploaded." | ||
- | & "$env:WINSCP_PATH\WinSCP.exe" "$sessionUrl" /refresh "$remotePath" | + | # Refresh the remote directory in WinSCP GUI, if -refresh switch was used |
+ | if ($refresh -and $needRefresh) | ||
+ | { | ||
+ | Write-Host "Reloading remote directory..." | ||
+ | ············& "$env:WINSCP_PATH\WinSCP.exe" "$sessionUrl" /refresh "$remotePath" | ||
+ | } | ||
} | } | ||
finally | finally |