powershell 模拟文件占用
摘要:脚本内容 $fileName = "test.txt" $fileObj = [System.io.File]::Open($fileName,'Open','Read','None') Write-Host "Press any key to contunue ..." $null = $host
阅读全文
powershell 取得程序exit code
摘要:###使用$LASTEXITCODE .\7za.exe a -tgzip test.gz test.txt >> $null if($LASTEXITCODE -eq 0) { Remove-Item -Path test.gz break; }
阅读全文