title: Multiple -and -or in PowerShell Where-Object statement
body: <pre><code>PS H:\&gt; Invoke-Command -computername SERVERNAME { Get-ChildItem -path E:\dfsroots\datastore2\public} | Where-Object {{ $_.e
  xtension-match "xls" -or $_.extension-match "xlk" } -and  { $_.creationtime -ge "06/01/2014"}}
  </code></pre>
  
  <p>Above is my code example. I'm trying to remotely run this PowerShell code on my file server and have it return all .xls and .xlk files with a creation date on or later than 6/1/2014. When I run this code it starts spitting out all of the folders in that remote location. If I only compare two things like so: </p>
  
  <pre><code>PS H:\&gt; Invoke-Command -computername SERVERNAME { Get-ChildItem -path E:\dfsroots\datastore2\public} | Where-Object { $_.extension-match "xls" -and  $_.creationtime -ge "06/01/2014"}
  </code></pre>
  
  <p>Only the xls files created on or after that date display. What's going on here? Do I need to use something other than nest <code>-and</code> and <code>-or</code> statements? </p>