
Implementing the Progress Bar: Using the Write-Progress
cmdlet in PowerShell, you can easily integrate a progress bar into your scripts. Here’s a simple example:
1 2 3 4 5 6 7 8 9 10 | $Count = 1 $Total = $OrdinateurClient .Rows.Count foreach ( $OrdinateurIP in $OrdinateurClient ) { Write-Progress -Activity "Processing " -status "Computers : $Count / $Total" -PercentComplete ( $Count / $Total * 100) -Id 1 $Count += 1 $Nom = $OrdinateurIP . "DISPLAYNAME" } } Write-Progress -Activity 'Processing' -Completed -Id 1 |
0 Comments