mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-19 00:46:30 +02:00
Updated the manuals
This commit is contained in:
@@ -6,7 +6,7 @@ This PowerShell script sends a magic UDP packet to a computer to wake him up (re
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
/home/markus/Repos/PowerShell/scripts/wake-up-host.ps1 [[-macAddr] <String>] [[-ipAddr] <String>] [[-udpPort] <Int32>] [[-numTimes] <Int32>] [<CommonParameters>]
|
||||
/Repos/PowerShell/scripts/wake-up-host.ps1 [[-macAddr] <String>] [[-ipAddr] <String>] [[-udpPort] <Int32>] [[-numTimes] <Int32>] [<CommonParameters>]
|
||||
|
||||
-macAddr <String>
|
||||
Specifies the host's MAC address (e.g. 11:22:33:44:55:66)
|
||||
@@ -18,7 +18,7 @@ Parameters
|
||||
Accept wildcard characters? false
|
||||
|
||||
-ipAddr <String>
|
||||
Specifies the host's IP address or subnet address (e.g. 192.168.0.255)
|
||||
Specifies the subnet address (e.g. 192.168.178.255)
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
@@ -52,8 +52,8 @@ Parameters
|
||||
Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./wake-up-host.ps1 11:22:33:44:55:66 192.168.100.100
|
||||
✅ Magic packet sent to IP 192.168.100.100, UDP port 9, 3x - wait a minute until the computer fully boots up.
|
||||
PS> ./wake-up-host.ps1 11:22:33:44:55:66 192.168.100.255
|
||||
✅ Sent magic packet to 192.168.100.255, UDP port 9 (3x). The device is up in a minute.
|
||||
|
||||
```
|
||||
|
||||
@@ -76,14 +76,14 @@ Script Content
|
||||
.PARAMETER macAddr
|
||||
Specifies the host's MAC address (e.g. 11:22:33:44:55:66)
|
||||
.PARAMETER ipAddr
|
||||
Specifies the host's IP address or subnet address (e.g. 192.168.0.255)
|
||||
Specifies the subnet address (e.g. 192.168.178.255)
|
||||
.PARAMETER udpPort
|
||||
Specifies the UDP port (9 by default)
|
||||
.PARAMETER numTimes
|
||||
Specifies # of times to send the packet (3 by default)
|
||||
.EXAMPLE
|
||||
PS> ./wake-up-host.ps1 11:22:33:44:55:66 192.168.100.100
|
||||
✅ Magic packet sent to IP 192.168.100.100, UDP port 9, 3x - wait a minute until the computer fully boots up.
|
||||
PS> ./wake-up-host.ps1 11:22:33:44:55:66 192.168.100.255
|
||||
✅ Sent magic packet to 192.168.100.255, UDP port 9 (3x). The device is up in a minute.
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@@ -106,13 +106,13 @@ function Send-WOL { param([string]$macAddr, [string]$ipAddr, [int]$udpPort)
|
||||
|
||||
try {
|
||||
if ($macAddr -eq "" ) { $macAddr = Read-Host "Enter the host's MAC address, e.g. 11:22:33:44:55:66" }
|
||||
if ($ipAddr -eq "" ) { $ipAddr = Read-Host "Enter the host's IP or subnet address, e.g. 192.168.0.255" }
|
||||
if ($ipAddr -eq "" ) { $ipAddr = Read-Host "Enter the subnet address, e.g. 192.168.178.255" }
|
||||
|
||||
for ($i = 0; $i -lt $numTimes; $i++) {
|
||||
Send-WOL $macAddr.Trim() $ipAddr.Trim() $udpPort
|
||||
Start-Sleep -milliseconds 100
|
||||
}
|
||||
"✅ Magic packet sent to IP $ipAddr, UDP port $udpPort, $($numTimes)x - wait a minute until the computer fully boots up."
|
||||
"✅ Sent magic packet to $ipAddr, UDP port $($udpPort) ($($numTimes)x). The device is up in a minute."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
@@ -120,4 +120,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 as of 11/20/2024 11:52:01)*
|
||||
*(page generated by convert-ps2md.ps1 as of 01/17/2025 08:30:58)*
|
||||
|
Reference in New Issue
Block a user