使用$LASTEXITCODE
.\7za.exe a -tgzip test.gz test.txt >> $null
if($LASTEXITCODE -eq 0)
{
Remove-Item -Path test.gz
break;
}
.\7za.exe a -tgzip test.gz test.txt >> $null
if($LASTEXITCODE -eq 0)
{
Remove-Item -Path test.gz
break;
}
本文来自博客园,作者:atq,转载请注明原文链接:https://www.cnblogs.com/atq999/p/14972886.html