How do you add more property values to a custom object

Viewed 54666

If I do this

$account = New-Object -TypeName psobject -Property @{User="Jimbo"; Password="1234"}

How do I add additional User and Password values to $account without overwriting the existing one?

I cannot pre-populate $account from a hashtable. I don't know all the users and passwords at runtime.

2 Answers
Related