Life, mostly, runs on C code.

Powershell’s tricks

Suppose you have a deep and complex folder tree and you need a list of folders containing specific files –like CSS files; say you wanna minify them; what would you do?

a clean dir *.css /s /b returns the files’ bare name and path, but there’s no grouping there… Oh wait! we have powershell! Let’s use it!

ls -Filter *.css -Recurse -Name | group -Property directoryname

^^ this returns a Dictionary> where the key is the unified folder names where .css files reside. easy huh? OK now go and minify those files… DONE? Oh wait! what if you’ve missed some files? I won’t check back manually! I can’t actually act like a ASP:Repeater! here comes the Powershell again!