Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

question on new-object -typename psobject

$
0
0

hi,

consider these 2 lines;

$properties = @{ 'MyProperty1' = 'Value1'; 'MyProperty2' = 'Value2' }
$object = New-Object –TypeName PSObject –Property $properties

this is a great trick, but there is something I do not understand.

the object created in this way has no name. if I wish to use this, how to I reference the created object?

can someone please give me an example?

thank you!


Viewing all articles
Browse latest Browse all 6937

Trending Articles