Differences

This shows you the differences between the selected revisions of the page.

library_example_download_clipboard 2017-10-03 library_example_download_clipboard 2022-06-16 (current)
Line 9: Line 9:
<code powershell - DownloadClipboard.ps1> <code powershell - DownloadClipboard.ps1>
# @name        &Download from Path in &Clipboard # @name        &Download from Path in &Clipboard
-# @command      powershell.exe -ExecutionPolicy Bypass -STA -File "%EXTENSION_PATH%" -sessionUrl "!S" -localPath "!\" %Pause% -sessionLogPath "%SessionLogPath%" +# @command      powershell.exe -ExecutionPolicy Bypass -STA -File "%EXTENSION_PATH%"
-# @description  Downloads remote file from a path stored in clipboard to the current local directory +#                  -sessionUrl "!E" -localPath "!\" %Pause% -sessionLogPath "%SessionLogPath%" 
-# @version      4+# @description  Downloads remote file from a path stored in clipboard
 +#                  to the current local directory 
 +# @version      6
# @homepage    ~~SELF~~ # @homepage    ~~SELF~~
-# @require      WinSCP 5.8.4+# @require      WinSCP 5.16
# @option      Pause -config pausecheckbox # @option      Pause -config pausecheckbox
# @option      SessionLogPath -config sessionlogfile # @option      SessionLogPath -config sessionlogfile
Line 19: Line 21:
param ( param (
-    # Use Generate 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-xx-xx-xx@example.com/",+    $sessionUrl = "sftp://user:mypassword;fingerprint=ssh-rsa-xxxxxxxxxxx...@example.com/",
    [Parameter(Mandatory = $True)]     [Parameter(Mandatory = $True)]
    $localPath,     $localPath,
Line 68: Line 70:
    $result = 0     $result = 0
} }
-catch [Exception]+catch
{ {
    Write-Host "Error: $($_.Exception.Message)"     Write-Host "Error: $($_.Exception.Message)"
Line 87: Line 89:
The //Pause at the end// makes the script wait for a key press when it finishes. The //Pause at the end// makes the script wait for a key press when it finishes.
-In the //Session log file// you can specify a path to a [[logging|session log file]].+In the //Session log file//, you can specify a path to a [[logging|session log file]]
 + 
 +In the //Keyboard shortcut//, you can specify a [[custom_key_shortcuts|keyboard shortcut]] for the extension.

Last modified: by martin