title: How to recursively search a directory for all files including hidden files in hidden directories, with PowerShell?
body: <p>To recursively search for a hidden file, I am using:</p>
  
  <pre><code>gci -Path C:\ -Filter part_of_filename* -Recurse -Force | where { $_.Attributes -match "Hidden"}
  </code></pre>
  
  <p>The output shows me many errors exactly like this (depending on the path):</p>
  
  <blockquote>
    <p>Get-ChildItem : Access to the path 'C:\Documents and Settings' is
    denied. At
    C:\Users\USERNAME\Documents\powershell\searchdisk.ps1:10
    char:5
    +  gci &lt;&lt;&lt;&lt;  -Path C:\ -Filter part_of_filename* -Recurse -Force | where { $_.Attributes -match "Hidden"}
        + CategoryInfo          : PermissionDenied: (C:\Documents and Settings:String) [Get-ChildItem], UnauthorizedAccessException
        + FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand</p>
  </blockquote>
  
  <p>I need a PowerShell command that recursively searches ANY directory including hidden directories and shows me all files including hidden files of the name part_of_filename* (for this example)</p>
  
  <p>I ran the command using PowerShell ISE as Administrator. It won't search inside directories like</p>
  
  <blockquote>
    <p>C:\Windows\System32\LogFiles\WMI\RtBackup</p>
  </blockquote>