![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Newbie | Search filenames only Hello, I'm a beginner in powershell. I'm wondering how I could search a directory of files for a match that occurs not in the contents of the files, but only in the names of the files? In Linux (bash), I could do: Code: ls | grep -i "match me" What about powershell? |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Search filenames only Quote: > > In Linux (bash), I could do: > > > Code: > -------------------- > ls | grep -i "match me" > -------------------- > and charting (and yes Regex is also included) then perhaps for a large numbers of files - FYI Remember, Windows PowerShell is not a data parser, but is a Windows-based automation tool, meant to pass "data" from tool to tool, to tool, until output (or whatever)! Mmm automate tools and there really are lots of Windows-based tools available, for Windows PowerShell to automateI So for here perhaps (like so many IT Pros) automate a data parser tool within powershell.exe! Perhaps Microsoft's IIS's (local or remote) data parser, Log Parser! PS > LogParser.exe -h -i:fs Input format: FS (FileSystem properties) Returns properties of files and folders "Log Parser" - Bing http://www.bing.com/search?q=%22Log+Parser%22 And surely after all these years, any PowerShell user can help one automate Log Parser too! As always enjoy the automation of tools within the Windows-based, ..NET aware, WPF accessible, admin's automation tool, powershell.exe! |
My System Specs![]() |
| | #3 (permalink) |
| Newbie | Re: Search filenames only It's been a little while, but I accidentally bumped into the solution the other day. In short form: Code: ls |? {$_.Name -match "match me"}
Code: Get-ChildItem | Where-Object {$_.Name -match "match me"}
|
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| More missing filenames! | Vista General | |||
| Missing Filenames | General Discussion | |||
| Filenames Do Not Match | Vista file management | |||
| Green Filenames - Why? | Vista General | |||
| filenames with [ characters | PowerShell | |||