the hard way:
$customObject = New-Object PSObject
$customObject | Add-Member NoteProperty Name "Marius"
$customObject | Add-Member NoteProperty Age "33"
$customObject | Add-Member NoteProperty Country "Romania"
the easy way:
$customObject = " " | Select-Object Name, Age, Country
$customObject.Name = "Marius"
$customObject.Age = "33"
$customObject.Country = "Romania"
The super easy way ;)
ReplyDelete[PSCustomObject]@{Name = "Marius";Age = 33;Country = "Romania"}