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.

Thread locked

Messages in this Thread

94,579 Postings in 11,930 Threads, 348 registered users, 14 users online (0 registered, 14 guests)
Index | Admin contact |   Forum Time: Nov 14, 2019 - 11:32 am EST  |  Hits:29,095,494  (5,410 Today )
RSS Feed