Created
May 13, 2021 03:11
-
-
Save NathanTheGr8/e3e15ddce6c0201ace13791681c030c9 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
$argument = '/installtunnelservice "C:\Program Files\WireGuard\Data\Configurations\wg0.conf"' | |
$action = New-ScheduledTaskAction -Execute 'C:\Program Files\WireGuard\wireguard.exe' -Argument $argument | |
$principal = New-ScheduledTaskPrincipal -UserID "NT AUTHORITY\SYSTEM" -LogonType ServiceAccount -RunLevel Highest | |
$trigger = New-ScheduledTaskTrigger -AtStartup | |
$task = New-ScheduledTask -Action $action -Principal $principal -Trigger $trigger | |
Register-ScheduledTask "WireGuard" -InputObject $task -Force -TaskPath "Custom" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment