PowerShell for the Easily Frustrated N00b, or, “A Simple and Useful Command”

The stupid, stupid Windows search (Start Menu > Search) doesn’t work on one of my computers (running WinXP Pro).  Yes, I made sure to add the network location that holds my files, and yes, I rebuilt the file index. The damn thing still ignores everything and claims I don’t have any files, anywhere.

Powershell to the rescue!

Yes, this is a very, VERY simple application of PowerShell, but today it came in insanely useful, and hey….I’m still a POSH n00b, okay? #Defensive

Here’s what I did:

  1. Start > Run > “PowerShell”
  2. cd “\\myUNC\users\jen\My Documents”
  3. Get-help dir 
    (…to get help on the command, because I forgot what parameters I needed. “dir” is an alias for “Get-ChildItem”, the true POSH cmdlet.)
  4. Get-ChildItem -Filter *restore*.sql –Recurse (this searches the directory and all subdirectories for all .SQL files with “restore” in the name).

Oh, THERE’S that stupid file….

Happy days,
Jen McCown
http://www.MidnightDBA.com/Jen

Learn more about PowerShell from my husband Sean on his blog, DBARant , and also through his POSH tutorials on MidnightDBA.com.

3 thoughts on “PowerShell for the Easily Frustrated N00b, or, “A Simple and Useful Command”

  1. Mike Irwin

    There are several sites to help – including one from MS itself! Personally, I use a tool called Agent Ransack – it’s free and faster than WinSearch!

  2. Pingback: Weekly Link Post 210 « Rhonda Tipton's WebLog

Comments are closed.