Creating objects in PowerShell is… strange, to put it lightly–down right awful if you want to be realistic. But even if the syntax is terrible, objects are still nice to use. Here’s a quick primer on how to create and use an object in PowerShell.
Creating a New Object
First let’s create an object using New-Object.
PS > $myObj = New-Object Object