title: olFolderCalendar in Outlook Interop assembly not showing all calendar entries
body: <p>I am using a function (<code>Get-OutlookCalendar</code>) from the <a href="https://devblogs.microsoft.com/scripting/use-powershell-to-export-outlook-calendar-information/" rel="nofollow noreferrer">Microsoft Scripting Guys blog</a> that looks like this:</p>
  <pre><code> Add-type -assembly &quot;Microsoft.Office.Interop.Outlook&quot; | out-null
   $olFolders = &quot;Microsoft.Office.Interop.Outlook.OlDefaultFolders&quot; -as [type]
   $outlook = new-object -comobject outlook.application
   $namespace = $outlook.GetNameSpace(&quot;MAPI&quot;)
   $folder = $namespace.getDefaultFolder($olFolders::olFolderCalendar)
   $folder.items |
   Select-Object -Property Subject, Start, Duration, Location
  </code></pre>
  <p>It works great.  The problem is that it doesn't seem to return all my calendar entries.  For example, I call the function with a where clause like this:</p>
  <pre><code>$datefmt = &quot;MM/dd/yyyy&quot;
  $today = (Get-Date).ToString($datefmt)
  $tomorrow = ((Get-Date).AddDays(1)).ToString($datefmt)
  Get-OutlookCalendar | where-object { $_.start -gt [datetime]$today -and $_.start -lt [datetime]$tomorrow } | Select-Object -Property Subject,Start |Sort-Object Start
  </code></pre>
  <p>From Outlook, I see four entries but the code only returns one entry.</p>
  <p>Is the calendar displayed in the UI somehow aggregating multiple folders or can anyone suggest some other reason?</p>