Skip to content

Commit ece41fa

Browse files
committed
Updated cd-scripts.ps1 and ping-host.ps1
1 parent 64bcdee commit ece41fa

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

scripts/cd-scripts.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
.DESCRIPTION
55
This PowerShell script changes the working directory to the PowerShell scripts folder.
66
.EXAMPLE
7-
PS> ./cd-scripts
8-
📂C:\Users\Markus\Repos\PowerShell\scripts
7+
PS> ./cd-scripts.ps1
8+
📂C:\Repos\PowerShell\scripts
99
.LINK
1010
https://github.com/fleschutz/PowerShell
1111
.NOTES

scripts/ping-host.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Specifies the hostname or IP address to ping (x.com by default)
88
.EXAMPLE
99
PS> ./ping-host.ps1 x.com
10-
✅ Host 'x.com' is UP (20ms latency to IP 104.244.42.65).
10+
✅ Host 'x.com' at IP 104.244.42.1 is up with 20ms latency.
1111
.LINK
1212
https://github.com/fleschutz/PowerShell
1313
.NOTES
@@ -22,11 +22,11 @@ try {
2222
[Threading.Tasks.Task]::WaitAll($tasks)
2323
foreach($ping in $tasks.Result) {
2424
if ($ping.Status -eq "Success") {
25-
Write-Host "✅ Host '$hostname' is UP ($($ping.RoundtripTime)ms latency to IP $($ping.Address))."
25+
Write-Output "✅ Host '$hostname' at IP $($ping.Address) is up with $($ping.RoundtripTime)ms latency."
2626
exit 0 # success
2727
}
2828
}
29-
Write-Host "⚠️ Host '$hostname' doesn't respond - check the connection or maybe the host is down (yet)."
29+
Write-Output "⚠️ Host '$hostname' doesn't respond - check the connection or maybe the host is down."
3030
exit 1
3131
} catch {
3232
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

0 commit comments

Comments
 (0)