Custom objects default display in PowerShell 3.0

Friday, April 13, 2012

In PowerShell 3.0 we can now create new custom objects using a hash table. PS> @{ One = 1 Two = 2 Three = 3 Four = 4 Five = 5 } One : 1 Two : 2 Three : 3 Four : 4 Five : 5 Behind the scenes, PowerShell creates a hash table and wraps it a PSCustomObject. It is way faster than using the New-Object cmdlet and it also provides consistency, while maintaining backwards compatibility. Another benefit of using...