I have the following command:
Get-ChildItem $build_path `
-Include *.bak, *.orig, *.txt, *.chirp.config `
-Recurse | Remove-Item -Verbose
to clear some files from the build folder of the VS solution. I use the Verbose switch so that I can see which files are being deleted. It works fine, but the output is too verbose:
VERBOSE: Performing operation "Remove File" on Target "R:\Visual Studio 2010\Projects\SomeProject\SomeProject.Web.build\App_Readme\glimpse.mvc3.readme.txt".
VERBOSE: Performing operation "Remove File" on Target "R:\Visual Studio 2010\Projects\SomeProject\SomeProject.Web.build\App_Readme\glimpse.readme.txt".
I just need to see something like this:
Removing file \App_Readme\glimpse.mvc3.readme.txt".
Removing file \App_Readme\glimpse.readme.txt".
...
I know that I can do this using the foreach statement and the Write-Host command, but I believe that this can be done using some kind of pipelining or something else. Any ideas?
source
share