November 02, 2011

1 articles on November 02, 2011

I don’t know about the RAM capacity in your head, but mine is kinda limited. Often time when I code in PowerShell, I don’t remember the exact name of a property/method. With the date and time object particularly. It’s different, yet very similar among the many programming languages I use daily.

so after I issue
$time=get-date

I usually fire up browser and go to Microsoft Technet PowerShell reference site to find the right command. I remember what it sounded like, but can’t remember exactly how to type it out. Yes you can type help get-date. But it doesn’t tell you all the properties and method you need.

if you want to know the list of all properties and method of an object/variable, set a value to a variable, and pass that variable to get-member cmdlet

$time=get-date
$time | get-member

You’ll get all the properties and method that belong to $time variable. A real time saver.