Skip to content

Instantly share code, notes, and snippets.

@aetos382
Last active June 30, 2017 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aetos382/3dc4070a669e98743dfc5fc72367c862 to your computer and use it in GitHub Desktop.
Save aetos382/3dc4070a669e98743dfc5fc72367c862 to your computer and use it in GitHub Desktop.
Write-Progress の使い方の試行
for ($stage = 0; $stage -lt 10; ++$stage) {
for ($step = 0; $step -lt 10; ++$step) {
Write-Progress `
-Activity 'インストール中' `
-Status "ステージ $stage" `
-CurrentOperation "ステップ $step" `
-PercentComplete ($stage * 10 + $step) `
-Id 0
Start-Sleep -Milliseconds 50
}
}
Write-Progress -Activity 'インストール中' -Id 0 -Completed
Pause
for ($stage = 0; $stage -lt 10; ++$stage) {
Write-Progress `
-Activity 'インストール中' `
-PercentComplete ($stage * 10) `
-Id 0
for ($step = 0; $step -lt 10; ++$step) {
Write-Progress `
-Activity "ステージ $stage" `
-Status "ステップ $step" `
-PercentComplete ($step * 10) `
-Id 1 `
-ParentId 0
Start-Sleep -Milliseconds 50
}
Write-Progress `
-Activity "ステージ $stage" `
-Id 1 `
-ParentId 0 `
-Completed
}
Write-Progress -Activity 'インストール中' -Id 0 -Completed
Pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment