Powershell Create Objects
hi,
i'm trying create objects in powershell. know can done through hash i'd practice objects.
any appreciated.
in excel entered as:
item1
cm pm
apr2014 17 18
may2014 20 22
item2
cm pm
apr2014 19 12
may2014 14 28
thank you
there's better way, can this:
# make empty array $array = @() # new object $obj = new-object system.object # add object $obj | add-member -type noteproperty -name "month" -value "apr2014" $obj | add-member -type noteproperty -name "cm" -value "17" $obj | add-member -type noteproperty -name "pm" -value "18" # add object array $array += $obj loop through.
- chris ream -
**remember, if find post helpful, or answer, please mark appropriately.**
Windows Server > Windows PowerShell
Comments
Post a Comment