Is there a way to get progress bar of just a certain about of computers that have a successful ping? In the example below, if I had 1500 computers to ping, I would only want to keep pinging computers if I did not get 100 successful pings. Is that possible? Thanks.
You can’t do what you are after with just what you have.
You need to have conditional code to check for that.
You also, Don’t want to make this endless/infinite loop check. Thus, look at using a DoWhile for the criteria you are after and exit after a certain number of tries.
Personally, I am not really sure why you want to do it this way. Either the machine responds or it does not, and move on. Sure, you could have a machine have a response hiccup, but just report that and move on.
You could do the later and try the list again, after the main effort completes.
Also, what you are using is not going to return what you say you are after.
Why are you using the .Net name space vs using the built-in cmdlets…
… cmdlet help file for usage details, or use one of the models via the MS powershellgallery.com resources.
Find-Module -Name '*progress*' | Format-Table -AutoSize
Version Name Repository Description
------- ---- ---------- -----------
0.132 PoshProgressBar PSGallery A module for creating WPF progress bars using XAML and the Material Design Toolkit by Butchers Boy
1.1 psInlineProgress PSGallery Inline Progress Bar for PowerShell
0.21 write-ProgressEx PSGallery Write-ProgressEx extends the functionality of the standard cmdlet. Write-ProgressEx is a powershell advanced function...