Files
dotfiles/scripts/pshell/Bridge-WslPorts-AddTaskToScheduler.ps1

6 lines
502 B
PowerShell
Executable File

$a = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-File `"/home/cloud/repos/personal-devboot/scripts/pshell/Bridge-WslPorts.ps1`" -WindowStyle Hidden -ExecutionPolicy Bypass"
$t = New-ScheduledTaskTrigger -AtLogon
$s = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
$p = New-ScheduledTaskPrincipal -GroupId "BUILTIN\Administrators" -RunLevel Highest
Register-ScheduledTask -TaskName "WSL2PortsBridge" -Action $a -Trigger $t -Settings $s -Principal $p