Showing posts with label powershell. Show all posts
Showing posts with label powershell. Show all posts

Sunday, August 30, 2009

How can I use PowerShell to delete all the files with a particular extension

Just run the command:

get-childitem rootdir -include *.extension -recurse | foreach ($_) {remove-item $_.fullname}


And that is it. Thanks Scripting Guy.



This is specially useful for me because very often, after I make changes in project reference in VS.NET some .dll files are left “out of sync” and and make parts your project act as if you did not re-compiled them. Sadly there is no easy way to tell VS.NET to get rid of all the .dll files that may be causing problems.

Saturday, August 22, 2009

How to find files containing a string with Powershell

A while ago a wrote a small post to remind me of How to find files containing a string in Unix.

Now, I have learned how to do pretty much the same thing but with Powershell:

get-childitem {directory} –include {file pattern} -recurse | select-string -pattern "{string to Find}" -casesensitive


You can write a path in {directory} or nothing to use the current directory.

Requirements Analysis: Negative Space

A while ago, I was part of a team working on a crucial project. We were confident, relying heavily on our detailed plans and clear-cut requi...