Created
December 31, 2016 13:56
-
-
Save EinPinsel/b04389c3a8b0ed08d1b0b2b788ace76a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Mac = "1A:2B:3C:4D:5E:6F" | |
$MacByteArray = $Mac -split "[:-]" | ForEach-Object { [Byte] "0x$_"} | |
[Byte[]] $MagicPacket = (,0xFF * 6) + ($MacByteArray * 16) | |
$UdpClient = New-Object System.Net.Sockets.UdpClient | |
$UdpClient.Connect(([System.Net.IPAddress]::Broadcast),7) | |
$UdpClient.Send($MagicPacket,$MagicPacket.Length) | |
$UdpClient.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment