#\r
# Author: Patrick Canterino <patrick@patrick-canterino.de>\r
# WWW: https://www.patrick-canterino.de/\r
-# https://github.com/pcanterino/dsmonrot/\r
+# https://github.com/pcanterino/dsmonrot\r
# License: 2-Clause BSD License\r
#\r
# Drive Snapshot is copyright by Tom Ehlert\r
$smbCredential = New-Object System.Management.Automation.PSCredential($smbUser, $secSmbPassword)\r
\r
New-PSDrive -Name $smbDrive -PSProvider "FileSystem" -Root $smbPath -Credential $smbCredential -Persist -ErrorAction Stop\r
- #net use "$smbDrive`:" $smbPath $smbPassword /user:$smbUser\r
}\r
else {\r
Write-Host "Without credentials"\r
\r
New-PSDrive -Name $smbDrive -PSProvider "FileSystem" -Root $smbPath -Persist -ErrorAction Stop\r
- #net use "$smbDrive`:" $smbPath\r
}\r
\r
$smbConnected = $True\r
exit\r
}\r
\r
- $dsArgs = @($disksToBackup, "$backupTargetFull\`$disk.sna", "-h$backupTargetFull\`$disk.hsh") + $dsAdditionalArgs\r
+ $dsArgs = @($disksToBackup, "$backupTargetDiff\`$disk.sna", "-h$backupTargetFull\`$disk.hsh") + $dsAdditionalArgs\r
Write-Host $dsPath ($dsArgs -join " ")\r
\r
& $dsPath $dsArgs\r
if($smbConnected) {\r
Write-Host "Disconnecting network drive"\r
Remove-PSDrive $smbDrive\r
- #net use "$smbDrive`:" /delete\r
}\r
\r
if($emailOnError -and $errorMessages.Count -gt 0) {\r