powershell scheduled task caller powershell scheduled task caller powershell powershell

powershell scheduled task caller


You can use the get-scheduledtask cmdlet. You find this cmdlet in the ScheduledTasks module.

Each returned task has an Actions Property.

E.g.

(Get-ScheduledTask)[0].Actions


To add on to Peter Schneider helpful answer which will give you details on the first task in the list. So, more specifically, to get them all, try this...

(((Get-ScheduledTask).Actions) | Select-Object *) -match 'powershell' | Select-Object -Property Id,Execute,Arguments | Format-Table -WrapId                 Execute        Arguments--                 -------        ---------StartPowerShellJob powershell.exe -NoLogo -NonInteractive -WindowStyle Hidden -Command "Import-Module PSScheduledJob; …

Note, the '*' gest all properties and you may not want to do that, so, just explicitly select the ones you'd want

(((Get-ScheduledTask).Actions) | Select-Object -Property Id,Execute,Arguments) -match 'powershell' | Format-Table -Wrap