答案 0 :(得分:0)
创建一个无案例,返回false并在3D触摸开始时调用该案例并在3D触摸结束时调用select case。
$what = "/copy:DAT /E /XD .svn /XD Debug /XF .pdb"
$options = "/R:4 /W:5 /TS /NS /Tee /NP"
$source = "C:\DataSource"
$destination = "D:\DataDestination"
$expression = [string]::Format('ROBOCOPY "{0}" "{1}" {2} {3}', $source,$Destination,$what,$options)
$rc = Invoke-Expression $expression
$rc = $LASTEXITCODE;
Switch ($rc)
{
0 {$msg = 'No files were copied. No failure was encountered. No files were mismatched.'}
1 {$msg = 'All files were copied successfully.'}
2 {$msg = 'There are some additional files in the destination directory that are not present in the source directory. No files were copied.'}
3 {$msg = 'Some files were copied. Additional files were present. No failure was encountered.'}
5 {$msg = 'Some files were copied. Some files were mismatched. No failure was encountered.'}
6 {$msg = 'Additional files and mismatched files exist. No files were copied and no failures were encountered. This means that the files already exist in the destination directory.'}
7 {$msg = 'Files were copied, a file mismatch was present, and additional files were present.'}
8 {$msg = 'Several files did not copy.'}
default {$msg = 'Robocopy failed with an error'}
}
$msg
If($rc -ge 8) {Throw}