ZTree.com  | ZEN  | About...  

 Index   Back

Sort of works   [Q]

By: Antti     Helsinki, FI  
Date: Dec 28,2018 at 18:35
In Response to: Use powershell (Ben Kent)

> The future is powershell, where this command only matches in the name part
> Get-ChildItem *sh*.*
>

I tested that, as follows:
powershell -command Get-ChildItem *sh*.*

This works fine, but does not seem to find matching files with no extension. Am I missing something?

Thus, it seems to me that this powershell alternative is more or less equaivalent to the dir alternative:
dir "*sh*.<"

However, the powershell version appears to execute much slower compared to the dir alternative...

For including files with no extension, one could pipe dir with findstr as follows:
dir /B *sh* | findstr /I "sh.*\. ^.[^.]*$"
But then you will only get the filenames listed. Similar regexp functionality is of course also available under powershell.

163 views      
 

Messages in this Thread

 
94,273 Postings in 11,892 Threads, 347 registered users, 9 users online (0 registered, 9 guests)
Index | Admin contact |   Forum Time: May 20, 2019 - 6:50 am EDT  |  Hits:27,735,821  (3,173 Today )
RSS Feed