-
Notifications
You must be signed in to change notification settings - Fork 10
How RobocopyPS handle native Robocopy errors
Simon edited this page May 26, 2022
·
2 revisions
In this example we try to use the -Backup parameter (/B) without having permission to do so. Invoke-Robocopy, at the moment, do not know if it should be a terminating or a non terminating error in PowerShell, so it will throw all errors it can find as non terminating and continue.
PS$ > Invoke-RoboCopy -Source "C:\Users\Simon\Downloads\" -Destination NULL -List -Recurse -Verbose -BackupMode VERBOSE: Performing the operation "List" on target "NULL from C:\Users\Simon\Downloads\".
Invoke-RoboCopy : ERROR : You do not have the Backup and Restore Files user rights.. ***** You need these to perform Backup copies (/B or /ZB).
At line:1 char:1
+ Invoke-RoboCopy -Source "C:\Users\Simon\Downloads\" -Destination NULL ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-RoboCopy], Exception
+ FullyQualifiedErrorId : Invoke-RoboCopy
Invoke-RoboCopy : ERROR : Robocopy ran out of memory, exiting.. ERROR : Invalid Parameter #%d : "%s"
At line:1 char:1
+ Invoke-RoboCopy -Source "C:\Users\Simon\Downloads\" -Destination NULL ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-RoboCopy], Exception
+ FullyQualifiedErrorId : Invoke-RoboCopy
Invoke-RoboCopy : ERROR : Invalid Job File, Line #%d :"%s". Started : %s %s
At line:1 char:1
+ Invoke-RoboCopy -Source "C:\Users\Simon\Downloads\" -Destination NULL ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-RoboCopy], Exception
+ FullyQualifiedErrorId : Invoke-RoboCopy
Source : C:\Users\Simon\Downloads\
Destination : NULL
Command : Robocopy.exe "C:\Users\Simon\Downloads" "NULL" *.* /r:3 /w:3 /e /b /l /bytes /TEE /np /njh /fp /v /ndl /ts
DirCount : 0
FileCount : 0
DirCopied : 0
FileCopied : 0
DirIgnored : 0
FileIgnored : 0
DirMismatched : 0
FileMismatched : 0
DirFailed : 0
FileFailed : 0
DirExtra : 0
FileExtra : 0
TotalTime : 00:00:00
StartedTime : 7/16/2019 10:21:53 PM
EndedTime : 7/16/2019 10:21:53 PM
TotalSize : 0 B
TotalSizeCopied : 0 B
TotalSizeIgnored : 0 B
TotalSizeMismatched : 0 B
TotalSizeFailed : 0 B
TotalSizeExtra : 0 B
Speed : 0 B/s
ExitCode : 16
Success : False
LastExitCodeMessage : [ERROR]Robocopy did not copy any files. Either a usage error or an error due to insufficient access privileges on the source or destination directories.