Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to add values to custom powreshell object

$
0
0

Hi Guy

 I'm new to powershell, i created a custom object via following codes

$a ='aaaa'
$b ='bbbb'
#Create a custom objec to save the output
$object = New-Object –TypeName PSObject
$object | Add-Member –MemberType NoteProperty –Name GroupName –Value $a
$object | Add-Member –MemberType NoteProperty –Name GroupName –Value $b

and write-oput $object should like this

GroupName                                                          GroupMember                                                      
---------                                                          -----------                                                      
aaaa                                                               bbbb                      

now what i want was add a new 'groupname' and 'groupmember' to the object , like

GroupName                                                          GroupMember                                                      
---------                                                          -----------                                                      
aaaa                                                               bbbb                    

cccc                                                               dddd

how can i achive this ?

                                       


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>