I am using robocopy
within PowerShell and robocopy
returns an exitcode 1 if a file has successfully been copied, which tells PowerShell it failed. Is there a good practice to ignore the error since its not an error?
$source = "$env:buildlocation\Reports\$env:ctrelname\DiskImages\DISK1";
$target = "$env:builddestination\$env:ctrelver\$env:ctrelname\Reports";
$robocopyOptions = @('/e', '/r:0', '/np');
Get-ChildItem -Path $source -Directory -Attributes !Hidden |
Sort-Object -Property CreationTime |
ForEach-Object { & robocopy.exe $source $target $robocopyOptions };
echo $LASTEXITCODE