Anexe uma tarefa no Taskscheilar usando PowerShell

$Action = New-ScheduledTaskAction -Execute 'pwsh.exe' -Argument '-NonInteractive -NoLogo -NoProfile -File "C:\MyScript.ps1"'
Tame Turtle