Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Find Folders that Match Pattern

$
0
0

Summary: Learn how to use Windows PowerShell to find folders with names that match a specific pattern.

Hey, Scripting Guy! Question How can I use Windows PowerShell to find the path to folders that have names that match a specific pattern?

Hey, Scripting Guy! Answer Use the Get-ChildItem cmdlet and the –Filter parameter with a pattern that matches the name, and then
           specify the  –Directory parameter. Here is an example that matches folders that have a four-letter name:

Get-ChildItem E:\Data\ScriptingGuys -filter "????" -Directory |

 % { $_.fullname }


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>