- $ready = $false; $task = "MediaCreate"; $action = "Layout"
- while (-not $ready) {
- [xml]$xml = get-content "$WS\Panther\windlp.state.xml"
- foreach ($t in $xml.WINDLP.TASK) { if ($t.Name -eq $task) { foreach ($a in $t.ACTION) { if ($a.ActionName -eq $action) {
- $total = $a.ProgressTotal; $current = $a.ProgressCurrent
- if ($null -ne $total -and 0 -ne $total -and $total -eq $current) {$ready = $true}
- if ($null -ne $current -and 0 -ne $current) {$done = [Convert]::ToInt64($current, 16)} else {$done = 0}
- write-host -nonew -fore Gray "`r${done}% "
- }}}} ; if ($mct.HasExited) {break :mct}; sleep -m 10000
- }
- $action = "IsoLayout"; if ($null -ne $USB) {$action = "UsbLayout"}
- write-host -fore Yellow "`r`nStarted $action"
复制代码 这个在批处理中的是powershell代码? |