Skip to main content

Microsoft PowerShell may be the worst product name for developers. If you write scripts I'm not classing you as a developer, I am classing people who understand Assemblies, Namespaces and Generics as developers for this post.

Anyway if you are a developer it should be called .Net Object to Text Render (and if Motorola made it NOTR), since that is what it actually does, it converts .Net objects to text. Once you understand that concept it gets a lot more powerful than the whole "DIR", "COPY" on a blue background than it appears the first time.

So it understands strings so this is possible:
PS C:\Documents and Settings\rmaclean> 'sadev'+'.co.za'
sadev.co.za

It also understands ints so this is also possible:
PS C:\Documents and Settings\rmaclean> 67 * 34 + 9 - 22
2064

And since .Net understands how to translate int's to strings, this becomes possible:
PS C:\Documents and Settings\rmaclean> 'sadev'+'.co.za' + (67 * 34 + 9 - 223) + 999
sadev.co.za2064999

And since objects can have properties you can start with Get-ChildItem which is like DIR for the old school in the audience, then add | where-object { $_.CreationTime -gt "1/29/2007" } to get all items created since Jan 29th 2007. Example
Get-ChildItem | where-object { $_.CreationTime -gt "1/29/2007" }

Then add on | epcsv to export the results to a CSV file.

Pure madness I say, pure developer insanity :D