title: Set data as true or false based on xml node value
body: <p>I have data that looks similar to the xml at the very bottom of this question. This is 3 of thousands of tasks. Some have <code>&lt;DayOfWeek&gt;</code> nodes, some don't. I am working on taking this data and putting it into a csv so that it can be imported into sql. </p>
  
  <p>My goal is to have each day be a column in the table and each row represent a task. If it is scheduled to run on a given day a 1 will be in the respective day, otherwise it will be a 0. For the below data at the bottom of this question, the table would look like this</p>
  
  <pre><code>| taskID | mon | tue | wed | thur | fri | sat | sun |
  |________|_____|_____|_____|______|_____|_____|_____|
  |    1   |  1  |  0  |  0  |  1   |  1  |  1  |  0  |
  |    2   |  1  |  0  |  0  |  0   |  1  |  0  |  0  |
  |    3   |  1  |  1  |  1  |  1   |  1  |  1  |  1  |
  </code></pre>
  
  <p>My current ps script makes this data more vertical as opposed to horizontal. An excerpt from the code</p>
  
  <pre><code>foreach($task in $config.Settings.Tasks.Task){
      $taskID = $task.ID
      foreach($DoW in $task.Schedules.Schedule.Days.DayOfWeek){
          $newCSV += @(New-Object -TypeName psobject -Property @{'taskID' = $taskID; 'Day' = $DoW})
      }
  }
  $newCSV | Export-Csv -Path c:\users\mhopkins\desktop\micSchedule\DoW.csv -notype
  </code></pre>
  
  <p>Can you guys help make this data work a little better in a table for me?</p>
  
  <p>XML snippit</p>
  
  <pre><code>&lt;Task ID="1" Name="name1" Active="1" NextEID="11"&gt;
      &lt;Schedules&gt;
          &lt;Schedule OnlyUntilFirstSuccess="0" FailIfNoSuccessInSched="0" RunEvenIfNotif="0"&gt;
              &lt;Days&gt;
                  &lt;DayOfWeek&gt;Monday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Friday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Thursday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Saturday&lt;/DayOfWeek&gt;
              &lt;/Days&gt;
          &lt;/Schedule&gt;
      &lt;/Schedules&gt;
  &lt;/Task&gt;
  &lt;Task ID="2" Name="name2" Active="1" NextEID="12"&gt;
      &lt;Schedules&gt;
          &lt;Schedule OnlyUntilFirstSuccess="0" FailIfNoSuccessInSched="0" RunEvenIfNotif="0"&gt;
              &lt;Days&gt;
                  &lt;DayOfWeek&gt;Monday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Friday&lt;/DayOfWeek&gt;
              &lt;/Days&gt;
          &lt;/Schedule&gt;
      &lt;/Schedules&gt;
  &lt;/Task&gt;
  &lt;Task ID="3" Name="name3" Active="0" NextEID="24" TT="COS" AR="0"&gt;
      &lt;Schedules&gt;
          &lt;Schedule OnlyUntilFirstSuccess="0" FailIfNoSuccessInSched="0" RunEvenIfNotif="1"&gt;
              &lt;Days&gt;
                  &lt;DayOfWeek&gt;Monday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Tuesday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Wednesday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Thursday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Friday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Saturday&lt;/DayOfWeek&gt;
                  &lt;DayOfWeek&gt;Sunday&lt;/DayOfWeek&gt;
              &lt;/Days&gt;
          &lt;/Schedule&gt;
      &lt;/Schedules&gt;
  &lt;/Task&gt;
  </code></pre>