exit code 1 is also good

This commit is contained in:
dechert 2022-08-05 22:18:15 +02:00
parent 8a47934604
commit 0f62910f62

View File

@ -1,6 +1,7 @@
<#
.SYNOPSIS
Run as ADMIN
Make sure you are logged in to network device first!
Creats Zip-Backup of everything inside Notes folder
Will be copied to the target folder provided via Parameter
.PARAMETER targetEnv
@ -65,6 +66,7 @@ robocopy . $pathToFolder $zipTarget /Z /r:60 /w:5 /MIR /MT:64 /NFL
# Zur Abwicklung der Authentifizierungsanforderung konnte keine Verbindung mit einem Domänencontroller hergestellt werden. Wiederholen Sie den Vorgang zu einem späteren Zeitpunkt.
# delete zip file in local folder if successfull
if ($LASTEXITCODE -eq 0) {
# robocopy exit code 1 = new file has been created
if ($LASTEXITCODE -eq 0 -or $LASTEXITCODE -eq 1) {
Remove-Item $zipTarget
}