How to get N files in a directory order by last modified date?
<p>I want to search for one or few files with latest modified date in a big directory. Trying some PowerShell code but it does not work well for me.</p>

<pre><code>Get-ChildItem 'D:\Temp' | Sort-Object LastWriteTime
</code></pre>

<p>I know that I can use <code>-Recurse</code> to search in all directories. But how to:</p>

<ul>
<li><p>Limit just some files</p></li>
<li><p>Order in descending mode</p></li>
<li><p>Do not list directory</p></li>
</ul>

<p>Thanks for your help! </p>