Skip to content

Commit 312686d

Browse files
author
Markus Fleschutz
committed
Update ping-local-devices.ps1
1 parent bb01ef8 commit 312686d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/ping-local-devices.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
.DESCRIPTION
55
This PowerShell script pings devices in the local network and lists which one are up.
66
.EXAMPLE
7-
PS> ./ping-local-hosts.ps1
8-
✅ Up: hippo jenkins01 jenkins02 rocket vega
7+
PS> ./ping-local-devices.ps1
8+
✅ Up: epson raspi tux
99
.LINK
1010
https://github.com/fleschutz/PowerShell
1111
.NOTES
@@ -16,7 +16,7 @@ param([int]$timeout = 600) # ms ping timeout
1616

1717

1818
try {
19-
$names = @('accesspoint','AD','AP','amnesiac','archlinux','auriga','berlin','boston','brother','canon','castor','cisco','echodot','epson','epson2815','fedora','fireball','firewall','fritz.box','fritz.nas','fritz.powerline','fritz.repeater','gassensor','gateway','hippo','heizung','hodor','homemanager','io','iphone','jarvis','jenkins','LA','laptop','linux','jupiter','mars','mercury','miami','mobile','none','none-1','none-2','NY','o2.lte','octo','office','officepc','paris','PI','pixel-6a','PC','pluto','printer','proxy','R2D2','raspberry','rocket','rome','router','sentinel','server','shelly','shelly1','smartphone','smartwatch','soundbar','speedport.ip','sunnyboy','surface','switch','tablet','tau','tigercat','tolino','tux','TV','ubuntu','vega','venus','xrx','zeus') # sorted alphabetically
19+
$names = @('accesspoint','AD','AP','amnesiac','archlinux','auriga','berlin','boston','brother','canon','castor','cisco','echodot','epson','epson2815','fedora','fireball','firewall','fritz.box','fritz.nas','fritz.powerline','fritz.repeater','gassensor','gateway','hippo','heizung','hodor','homemanager','io','iphone','jarvis','jenkins','LA','laptop','linux','jupiter','mars','mercury','miami','mobile','none','none-1','none-2','NY','o2.lte','octo','office','officepc','paris','PI','pixel-6a','PC','pluto','printer','proxy','R2D2','raspberry','raspi','rocket','rome','router','sentinel','server','shelly','shelly1','smartphone','smartwatch','soundbar','speedport.ip','sunnyboy','surface','switch','tablet','tau','tigercat','tolino','tux','TV','ubuntu','vega','venus','xrx','zeus') # sorted alphabetically
2020
$queue = [System.Collections.Queue]::new()
2121
foreach($name in $names) { $ping = [System.Net.Networkinformation.Ping]::new()
2222
$queue.Enqueue( @{Host=$name;Ping=$ping;Async=$ping.SendPingAsync($name,$timeout)} )

0 commit comments

Comments
 (0)