title: scheduled tasks don't show up in Get-ScheduledTask result
body: <p>I have defined some scheduled task using Windows Task Scheduler GUI under "\" [default] path but when i run <code>Get-ScheduledTask</code> in powershell, it does not return them. why?</p>
  
  <p>I have tried with <code>Get-ScheduledTask -TaskName "MyTaskName"</code> with one of my task name but it comes up with "No MSFT_ScheduledTask objects found with property 'TaskName' equal to 'MyTaskName'"</p>
  
  <p>Actually I have tried <a href="https://library.octopusdeploy.com/step-template/actiontemplate-windows-scheduled-task-disable" rel="noreferrer">https://library.octopusdeploy.com/step-template/actiontemplate-windows-scheduled-task-disable</a> but it doesn't work so I have tried running script directly.</p>
  
  <p><strong>UPDATE</strong>
  I have found the following script to get task list on <a href="http://www.fixitscripts.com/problems/getting-a-list-of-scheduled-tasks" rel="noreferrer">http://www.fixitscripts.com/problems/getting-a-list-of-scheduled-tasks</a>:</p>
  
  <pre><code># PowerShell script to get scheduled tasks from local computer
  $schedule = new-object -com("Schedule.Service")
  $schedule.connect() 
  $tasks = $schedule.getfolder("\").gettasks(0)
  $tasks  | Format-Table   Name , LastRunTime    # -AutoSize
  IF($tasks.count -eq 0) {Write-Host “Schedule is Empty”}
  Read-Host
  </code></pre>
  
  <p>Thanks in advance for you help.</p>