Auto-Update On Login (Helpful Tip) 1.36.0+

Good Afternoon,
I wrote the Powershell below to auto update my users devices automatically on login. Open Powershell as an ADMIN and run the attached code. Seems to work well for me so I thought I would share.

$action = New-ScheduledTaskAction -Execute 'C:\Program Files\Tailscale\tailscale.exe' -Argument 'update --yes'
$trigger = New-ScheduledTaskTrigger -AtLogon
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest
$settings = New-ScheduledTaskSettingsSet -Hidden

Register-ScheduledTask -Action $action -Trigger $trigger -TaskPath "Tailscale" -TaskName "TailScale Update" -Principal $principal -Settings $settings