title: File extension while searching
body: <p>I am trying to get a list of all my files with a specific extension. </p>
  
  <pre><code>(...)$_.Extension -eq ".$ext"
  </code></pre>
  
  <p>I read extension from console to script.</p>
  
  <p>My question is how to find any file with an extension of  <code>.*</code>?</p>
  
  <p><strong>Edit:</strong> </p>
  
  <p>Here's the rest of the code:</p>
  
  <pre><code>$setOfFolders = (Get-ChildItem -Path D:\ -Directory).name 
  Write-host "Set last write date " -ForegroundColor Yellow -NoNewline 
  $ostZmiana= read-host $exten = read-host "Set extensions " 
  
  ForEach ($f in $setOfFolders) 
  { 
      $saveTofile = "C:\Users\pziolkowski\Desktop\Outs\$f.txt" 
      Get-ChildItem -Path D:\Urzad\Wspolny\$f -Recurse | ? {$_.LastAccessTime -lt $ostZmiana -and $_.Extension -eq ".$exten"} | % {Get-acl $_.FullName} |sort Owner | ft -AutoSize -Wrap Owner, @{Label="ShortPath"; Expression= $_.Path.Substring(38)}} &gt; $saveToFile 
  }
  </code></pre>