Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepowershell
C:\PS> Get-JobSchedulerTask | Stop-JobSchedulerTask
  • The Get-JobSchedulerTask cmdlet retrieves all running tasks.
  • The list of tasks is piped to the Stop-JobSchedulerTask cmdlet.
  • Depending on the system load the killing of tasks might take some seconds. Repeatedly executing the Get-TaskJobSchedulerTask cmdlet should prove that no further tasks are running.

Kill tasks for any running jobs that are located in a folder

Code Block
languagepowershell
C:\PS> Get-JobSchedulerJob /some_folder/some_subfolder | Get-JobSchedulerTask -Recursive -Running | Stop-JobSchedulerTask
  • The Get-JobSchedulerJob cmdlet retrieves jobs starting from the specified directory. Any subfolders sub-folders of that directory are included unless if the -NoSubfoldersRecursive parameter is specified.The Get-JobSchedulerTask cmdlet retrieves all running tasks for the list of jobs.
  • The list of tasks is piped pipelined to the Stop-JobSchedulerTask cmdlet.

Kill tasks for any jobs of a job chain

Code Block
languagepowershell
C:\PS> Get-JobSchedulerJobChain -JobChain /some_folder/some_job_chain | Get-JobSchedulerJob | Get-JobSchedulerTaskRunning | Stop-JobSchedulerTask

See also

  • The Stop-TaskJobSchedulerTask cmdlet supports a number of actions to kill (sending SIGKILL) and to terminate (sending SIGTERM) signals to processes, For details see How to Terminate Tasks.

...