August 23, 2010
An example how to use Write-Progress if you don't have a loop:


001
002
003
004
005
006
007
008
009
010
011
012
013
Write-Progress -Activity "Collecting Information" -status "Wait..." -PercentComplete "1" -Id 1
Start-Sleep -s 3
Write-Progress -Activity "Collecting Information" -status "Wait..." -PercentComplete "20" -Id 1
Start-Sleep -s 3
Write-Progress -Activity "Collecting Information" -status "Wait..." -PercentComplete "40" -Id 1
Start-Sleep -s 3
Write-Progress -Activity "Collecting Information" -status "Wait..." -PercentComplete "60" -Id 1
Start-Sleep -s 3
Write-Progress -Activity "Collecting Information" -status "Wait..." -PercentComplete "80" -Id 1
Start-Sleep -s 3
Write-Progress -Activity "Collecting Information" -status "Wait..." -PercentComplete "100" -Id 1
Start-Sleep -s 3
Write-Progress -Activity "Collecting Information" -status "Completed" -Completed -Id 1

0 kommentarer: