PowerShell - Terse Expression

Before PowerShell I would open up VS.NET and start quick projects attempting to test the length of strings, concatenation, padding or creating file\folder manipulation app's that are good for one use. Every few months I would slog through tens of half used applications ... that was before ... now I open the PowerShell console.

Imagine writing a recursive file search function in C# that would only select files that begin with a specific subset of characters. Now image writing that function in one line:

Get-ChildItem -Path C:\Windows -Include *.dll -Recurse -Exclude [a-g]*.dll

Priceless.

 

"There is only one cure for gray hair. It was invented by a Frenchman. It is called the guillotine." - P.G. WodeHouse

Technorati tags: , ,


Comment Section

Comments are closed.