Created
October 17, 2018 09:18
-
-
Save Zazcallabah/aedc90f811d1c3239c08dabbc85dae1f to your computer and use it in GitHub Desktop.
Wake-on-lan trigger
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
param ([String]$mac = "00:11:22:33:00:11") | |
$MACAddr = $mac.split(':') | %{ [byte]('0x' + $_) }; | |
$UDPclient = new-Object System.Net.Sockets.UdpClient | |
$UDPclient.Connect(([System.Net.IPAddress]::Broadcast),4000) | |
$packet = [byte[]](,0xFF * 6) | |
$packet += $MACAddr * 16; | |
[void] $UDPclient.Send($packet, $packet.Length) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment