Differences

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

2017-07-23 2017-10-03
plural - it's batch after all (martin) using variable expansion in strings in powershell (martin)
Line 19: Line 19:
# @description  Renames remote files using a regular expression # @description  Renames remote files using a regular expression
# @flag        RemoteFiles # @flag        RemoteFiles
-# @version      1+# @version      2
# @homepage    ~~SELF~~ # @homepage    ~~SELF~~
# @require      WinSCP 5.8.4 # @require      WinSCP 5.8.4
Line 56: Line 56:
        {         {
            $newName = $file -replace $pattern, $replacement             $newName = $file -replace $pattern, $replacement
-            Write-Host ("{0} => {1}" -f $file, $newName)+            Write-Host "$file => $newName"
            if ($newName -ne $file)             if ($newName -ne $file)
            {             {
Line 115: Line 115:
            {             {
                $newName = $file -replace $pattern, $replacement                 $newName = $file -replace $pattern, $replacement
-                Write-Host ("{0} => {1}" -f $file, $newName)+                Write-Host "$file => $newName"
                $fullName = $session.CombinePaths($remotePath, $file)                 $fullName = $session.CombinePaths($remotePath, $file)

Last modified: by martin