File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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 ]) "
You can’t perform that action at this time.
0 commit comments