Differences

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

2016-04-29 2016-05-24
error: prefix (martin) configurable (martin)
Line 17: Line 17:
<code powershell - FindDuplicates.ps1> <code powershell - FindDuplicates.ps1>
# @name        Find &Duplicates # @name        Find &Duplicates
-# @command      powershell.exe -ExecutionPolicy Bypass -File "%EXTENSION_PATH%" -sessionUrl "!S" -remotePath "!/" -pause+# @command      powershell.exe -ExecutionPolicy Bypass -File "%EXTENSION_PATH%" -sessionUrl "!S" -remotePath "!/" %Pause% -remoteChecksumAlg "%RemoteChecksumAlg%" -sessionLogPath "%SessionLogPath%"
# @description  Searches for duplicate files on the server, starting from the current directory # @description  Searches for duplicate files on the server, starting from the current directory
# @flag        RemoteFiles # @flag        RemoteFiles
-# @version      1+# @version     
 +# @homepage    ~~SELF~~ 
 +# @require      WinSCP 5.8.3 
 +# @option      RemoteChecksumAlg combobox "&Checksum:" "local" "local=Local sha-1" "sha1=Remote sha-1" "sha256=Remote sha-256" "md5=Remote md5"  
 +# @option      SessionLogPath file "&Session log file:" "%APPDATA%\mylog.log" 
 +# @option      Pause checkbox "&Pause at the end" -pause -pause 
 +# @optionspage  ~~SELF~~#options
param ( param (
Line 28: Line 34:
    $remotePath,     $remotePath,
    $remoteChecksumAlg = $Null,     $remoteChecksumAlg = $Null,
 +    $sessionLogPath = $Null,
    [Switch]     [Switch]
    $pause = $False     $pause = $False
Line 36: Line 43:
    if (!($checksums.ContainsKey($remotePath)))     if (!($checksums.ContainsKey($remotePath)))
    {     {
-        if ($remoteChecksumAlg -eq $Null)+        if (!$remoteChecksumAlg -or ($remoteChecksumAlg -eq "local"))
        {         {
            Write-Host ("Downloading file {0}..." -f $remotePath)             Write-Host ("Downloading file {0}..." -f $remotePath)
Line 142: Line 149:
    try     try
    {     {
 +        $session.SessionLogPath = $sessionLogPath
 +
        # Connect         # Connect
        $session.Open($sessionOptions)         $session.Open($sessionOptions)

Last modified: by martin