Quicktip: Create an object that refers to its own properties
Quicktip: Create an object that refers to its own properties
Recently I received the question the /r/PowerShell community if it was possible to create an object that refers to its own properties when it is created. The user specified that they would prefer to create this as a one-liner. Using the Add-Member cmdlet in combination with the -Passthru parameter this is quite simple to do, for example: $Object = New-Object PSObject -property @{ Property1 =…
View On WordPress












