Add-Member if you want to effectively “object” all things and possess their property.

I thought I would clarify this as most articles don’t simplify this to easily wrap you head around.

Add-member is what I would use to add a new member to a group of properties on an object

  1. I create the object
  2.  Add a noteproperty that translate to text
  3. create a scriptmethod that can do things based on a scriptblock when called.
  4. create a scriptproperty that runs each time you call the $x object to display the results of it’s script block.
Here is the code:
$x=new-object psobject
$x| add-member -name ID – value “smithx” -membertype Noteproperty
$x| add-member -name ADlookup -value { get-aduser $x.name } -membertype scriptmethod
$x|add–member -name ADinfo -value {$x.adlookup()} -membertype Scriptproperty

if you want you can overwrite a member with the -force command.