Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fast ping function for PowerShell [closed]

Tags:

powershell

Is there a fast function for pinging a list of machines using PowerShell?

I know I can use Test-Connection:

Test-Connection -Count 1 -ComputerName (gc .\comps.txt) -ea silentlycontinue

but this seems painfully slow (I'm assuming because it uses Win32_PingStatus).

Even better would be an example of how running it as a background job to speed it up would be most useful.

like image 424
fenster Avatar asked Aug 12 '10 18:08

fenster


People also ask

What command can you use instead of ping in PowerShell?

Unlike the familiar ping command, Test-Connection returns a TestConnectionCommand+PingStatus object that you can investigate in PowerShell. The Quiet parameter returns a Boolean value in a System. Boolean object for each tested connection. If multiple connections are tested, an array of Boolean values is returned.

How do you stop ping in PowerShell?

You can't stop a continuous ping without signaling the ping process to stop. You would need to use ping /n COUNT for a number of pings.

How do I run a ping command in PowerShell?

So, how do you ping in PowerShell? Use the 'Test-Connection' applet. It's that easy. Much like you would use 'ping' in CMD, type in 'Test-Connection' followed by '-Ping', '-TargetName', and an IP address to send a ping to that device.


1 Answers

The PowerShell Community Extensions include a fast ping (among other useful scripts and aliases)

http://pscx.codeplex.com/

like image 199
mwilson Avatar answered Sep 23 '22 02:09

mwilson