-1

Before deleting a task in the task scheduler with schtasks command, how can I check that a target task already exists or not with PowerShell?

My question is deferent of yours, and sodawillow solved my problem! thank you.

Fastso
  • 23
  • 1
  • 5
  • 1
    Possible duplicate of [Testing to see if a scheduled task exist in powershell](http://stackoverflow.com/questions/17703768/testing-to-see-if-a-scheduled-task-exist-in-powershell) – Matt Dec 13 '15 at 14:20

1 Answers1

3

You can check if it is in this list:

Get-ScheduledTask | Select -ExpandProperty TaskName
sodawillow
  • 12,497
  • 4
  • 34
  • 44