title: Powershell date range from calendar object to array
body: <p>I have a powershell GUI calendar in which you can select a range of dates. I need to be able to covert that info into an array of dates formatted YYYYMMDD.</p>
  
  <p>I know $Date = "{0:yyyyMMdd}" -f (Get-Date) will work but I can't seem to get the items into the array.</p>
  
  <p>I need an array like this:</p>
  
  <pre><code>20130211
  20130212
  20130213
  </code></pre>
  
  <p>Here's the code so far. Thanks for your help!</p>
  
  <pre><code>$Calendar = New-Object System.Windows.Forms.MonthCalendar 
  $Calendar.Location = New-Object System.Drawing.Size(10,80)
  $Calendar.ShowTodayCircle = $False
  $Calendar.MaxDate = (Get-Date).AddDays(1)
  $Calendar.MaxSelectionCount = $CalendarSelect
  $MenuBox.Controls.Add($Calendar) 
  $Dates = $Calendar.SelectionRange
  </code></pre>
  
  <p>So $Dates will need to be converted into the array. Thanks again!</p>