title: Powershell Get-Item not working on some directories like AppData while Get-ChildItem does
body: <p>Why does <code>Get-Item</code> not work on some directories? For example <code>gi $env:USERPROFILE\AppData</code> returns &quot;Could not find item&quot;, but <code>ls $env:USERPROFILE\AppData</code> works fine and can list files?</p>
  <p>I want to use <code>gi</code> to pass a string to it to turn it into an object that has other members like <code>LastWriteTime</code>. If I use <code>ls</code> for <code>Get-ChildItem</code> I get the children, i.e. files in the directory, but not the directory.</p>
  <p>I can work around this by using a filter on the parent like this: <code>ls -h $env:USERPROFILE | ? {$_.Name -match &quot;AppData&quot;} | select Name,LastWriteTime</code> - but there has to be a better way and it does not explain why <code>gi</code> does not work directly.</p>