Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • @ChadDye .... I will add that this approach is also not "particularly elegant or groundbreaking" but it may suffice for your specific needs while allowing the use of the ping command as you desire. Commented Apr 5 at 1:58
  • Also, I used the value of target from the list being iterated in the loop to display the target being pinged. I interpreted that as the list may have IP or DNS name, so that matches what is in the target for objects that can be pinged. For the line where they are pingable, I also played with this a bit to get back the IP so if the list pings DNS name, this will show the IP rather than name defined in the list as the target If($p -match "Reply from"){"$($p.split()[2].replace(':','')),$($p.split('=')[2].replace('TTL','').Trim())"}. You can play with that in case it helps too. Commented Apr 5 at 2:02