mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-04 15:44:44 +02:00
Renamed ping-hosts.ps1 to ping-local-hosts.ps1
This commit is contained in:
parent
22b72f2071
commit
702540704b
@ -22,4 +22,5 @@
|
|||||||
& "$PSScriptRoot/check-dns.ps1"
|
& "$PSScriptRoot/check-dns.ps1"
|
||||||
& "$PSScriptRoot/check-vpn.ps1"
|
& "$PSScriptRoot/check-vpn.ps1"
|
||||||
& "$PSScriptRoot/list-public-ip.ps1"
|
& "$PSScriptRoot/list-public-ip.ps1"
|
||||||
|
& "$PSScriptRoot/ping-local-hosts.ps1"
|
||||||
exit 0 # success
|
exit 0 # success
|
@ -2,9 +2,9 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Pings local hosts
|
Pings local hosts
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script pings well-known hostnames in the local network and lists which one up.
|
This PowerShell script pings the computers in the local network and lists which one are up.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-hosts.ps1
|
PS> ./ping-local-hosts.ps1
|
||||||
✅ Up are: Hippo Jenkins01 Jenkins02 Rocket Vega
|
✅ Up are: Hippo Jenkins01 Jenkins02 Rocket Vega
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
@ -18,7 +18,7 @@ try {
|
|||||||
$hostsArray = $hosts.Split(",")
|
$hostsArray = $hosts.Split(",")
|
||||||
$count = $hostsArray.Count
|
$count = $hostsArray.Count
|
||||||
|
|
||||||
Write-Progress "Sending pings to $count local hosts..."
|
Write-Progress "Sending pings to the local hosts..."
|
||||||
$queue = [System.Collections.Queue]::new()
|
$queue = [System.Collections.Queue]::new()
|
||||||
foreach($hostname in $hostsArray) {
|
foreach($hostname in $hostsArray) {
|
||||||
$ping = [System.Net.Networkinformation.Ping]::new()
|
$ping = [System.Net.Networkinformation.Ping]::new()
|
Loading…
Reference in New Issue
Block a user