Updated wake-up-host.ps1

This commit is contained in:
Markus Fleschutz 2024-12-19 13:19:54 +01:00
parent e481bfbed4
commit 067052251a

View File

@ -13,8 +13,7 @@
Specifies # of times to send the packet (3 by default) Specifies # of times to send the packet (3 by default)
.EXAMPLE .EXAMPLE
PS> ./wake-up-host.ps1 11:22:33:44:55:66 192.168.100.255 PS> ./wake-up-host.ps1 11:22:33:44:55:66 192.168.100.255
Sent magic packet 3 times to subnet 192.168.100.255, UDP port 9. Sent magic packet to 192.168.100.255, UDP port 9 (3x). The device is up in a minute.
NOTE: wait a minute until the computer fully boots up.
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -43,8 +42,7 @@ try {
Send-WOL $macAddr.Trim() $ipAddr.Trim() $udpPort Send-WOL $macAddr.Trim() $ipAddr.Trim() $udpPort
Start-Sleep -milliseconds 100 Start-Sleep -milliseconds 100
} }
"✅ Sent magic packet $numTimes times to subnet $ipAddr, UDP port $($udpPort)." "✅ Sent magic packet to $ipAddr, UDP port $($udpPort) ($($numTimes)x). The device is up in a minute."
" NOTE: wait a minute until the computer fully boots up."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"