With PowerShell, I want to create a new task that starts a Python script:
Setting it this way via the GUI Task Scheduler works, but in my PowerShell code below, I don't know how to specify the "add arguments" field:
$action = New-ScheduledTaskAction -Execute "C:\Program Files\Python\Python38\python.exe"
$trigger = New-ScheduledTaskTrigger -Daily -At 5:00am
$trigger.StartBoundary = [DateTime]::Parse($trigger.StartBoundary).ToLocalTime().ToString("s")
$settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit 0
Register-ScheduledTask -Action $action -Trigger $trigger -Settings $settings -TaskName "Full Computer Backup" -Description "Backs up computer"
What change must I make to the PowerShell code to add the argument (in this case, the path to the python script [.py
file])?