title: powershell get name from array of objects
body: <p>I need to get all names of all schedules tasks which i do like this:</p>
  <pre><code>$tasks = Get-ScheduledTask | Get-ScheduledTaskInfo | Select TaskName,LastRunTime,LastTaskResult
  </code></pre>
  <p>Output looks something like this:</p>
  <pre><code>TaskName                                                LastRunTime                                                                                     LastTaskResult
  --------                                                -----------                                                                                     --------------
  GoogleUpdateTaskMachineCore                             31. 5. 2021 0:29:29                                                                                          0
  </code></pre>
  <p>Which is alright, but i wanna take only task names and print each one new line.</p>
  <p>I tried this:</p>
  <pre><code>foreach($task in $tasks){
      Write-Host &quot;$task.TaskName&quot;
  }
  </code></pre>
  <p>But output is this:</p>
  <pre><code>@{TaskName=Adobe Acrobat Update Task; LastRunTime=05/31/2021 11:14:14; LastTaskResult=0}.TaskName
  @{TaskName=FSRM_Update; LastRunTime=05/31/2021 08:00:00; LastTaskResult=0}.TaskName
  </code></pre>
  <p>Can someone point me in right direction what am i doing wrong and why is output like this?</p>
  <p>//EDIT
  Found answer here:
  <a href="https://stackoverflow.com/questions/17703768/testing-to-see-if-a-scheduled-task-exist-in-powershell">Testing to see if a scheduled task exist in powershell</a></p>