Differences

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

2017-02-03 2017-10-04
explicit anchor use (martin) using variable expansion in strings in powershell (martin)
Line 239: Line 239:
    if ($e.Error -eq $Null)     if ($e.Error -eq $Null)
    {     {
-        Write-Host ("Upload of {0} succeeded" -f $e.FileName)+        Write-Host "Upload of $($e.FileName) succeeded"
    }     }
    else     else
    {     {
-        Write-Host ("Upload of {0} failed: {1}" -f $e.FileName, $e.Error)+        Write-Host "Upload of $($e.FileName) failed: $($e.Error)"
    }     }
Line 250: Line 250:
        if ($e.Chmod.Error -eq $Null)         if ($e.Chmod.Error -eq $Null)
        {         {
-            Write-Host ("Permisions of {0} set to {1}" -f $e.Chmod.FileName, $e.Chmod.FilePermissions)+            Write-Host "Permisions of $($e.Chmod.FileName) set to $($e.Chmod.FilePermissions)"
        }         }
        else         else
        {         {
-            Write-Host ("Setting permissions of {0} failed: {1}" -f $e.Chmod.FileName, $e.Chmod.Error)+            Write-Host "Setting permissions of $($e.Chmod.FileName) failed: $($e.Chmod.Error)"
        }         }
Line 260: Line 260:
    else     else
    {     {
-        Write-Host ("Permissions of {0} kept with their defaults" -f $e.Destination)+        Write-Host "Permissions of $($e.Destination) kept with their defaults"
    }     }
Line 267: Line 267:
        if ($e.Touch.Error -eq $Null)         if ($e.Touch.Error -eq $Null)
        {         {
-            Write-Host ("Timestamp of {0} set to {1}" -f $e.Touch.FileName, $e.Touch.LastWriteTime)+            Write-Host "Timestamp of $($e.Touch.FileName) set to $($e.Touch.LastWriteTime)"
        }         }
        else         else
        {         {
-            Write-Host ("Setting timestamp of {0} failed: {1}" -f $e.Touch.FileName, $e.Touch.Error)+            Write-Host "Setting timestamp of $($e.Touch.FileName) failed: $($e.Touch.Error)"
        }         }
Line 278: Line 278:
    {     {
        # This should never happen during "local to remote" synchronization         # This should never happen during "local to remote" synchronization
-        Write-Host ("Timestamp of {0} kept with its default (current time)" -f $e.Destination)+        Write-Host "Timestamp of $($e.Destination) kept with its default (current time)"
    }     }
} }
Line 320: Line 320:
catch [Exception] catch [Exception]
{ {
-    Write-Host ("Error: {0}" -f $_.Exception.Message)+    Write-Host "Error: $($_.Exception.Message)"
    exit 1     exit 1
} }

Last modified: by martin