update
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
## Target MAC address
|
||||
$Mac = "f8:bc:12:83:ce:3e"
|
||||
|
||||
$MacByteArray = $Mac -split "[:-]" | ForEach-Object { [Byte] "0x$_"}
|
||||
[Byte[]] $MagicPacket = (,0xFF * 6) + ($MacByteArray * 16)
|
||||
Try
|
||||
{
|
||||
$UdpClient = New-Object System.Net.Sockets.UdpClient
|
||||
$UdpClient.Connect(([System.Net.IPAddress]::Broadcast),7)
|
||||
$UdpClient.Send($MagicPacket,$MagicPacket.Length)
|
||||
$UdpClient.Close()
|
||||
}
|
||||
Catch { Write-Output $_.Exception.Message }
|
||||
Reference in New Issue
Block a user