ahh i knew i could rely on you! thank you very, very much!
Have a good day!
Have a good day!
$DifferentLocalAssetSize += $diff.Local.Length
...
$localdiffs = $session.CompareDirectories([WinSCP.SynchronizationMode]::Remote, $localPath, $remotePath, $True ,$True, [WinSCP.SynchronizationCriteria]::Size, $transferOptions)
$DifferentLocalAssets = 0
$DifferentLocalAssetSize = 0
foreach ($diff in $localdiffs)
{
if (($diff.Action -eq [WinSCP.SynchronizationAction]::UploadNew) -or
($diff.Action -eq [WinSCP.SynchronizationAction]::UploadUpdate))
{
$DifferentLocalAssets++
$DifferentLocalAssetSize = $DifferentLocalAssetSize + $fileInfo.Length
}
}
finally
{
Write-Host "$DifferentLocalAssets Assets ($DifferentLocalAssetSize *UNIT*) will be uploaded next sync"
# Disconnect, clean up
$session.Dispose()
}
...