Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Object = [PSCustomObject]@{
- Id = "1"
- Name = "VM01"
- Description = "A virtual machine"
- Location = "UK"
- IPAddress = "10.0.0.1"
- }
- $Object.PSObject.TypeNames.Insert(0, "Test.Type")
- Update-TypeData -TypeName "Test.Type" -DefaultDisplayPropertySet "Id", "Name", "Description" -Force
- $Object
- # Id Name Description
- # -- ---- -----------
- # 1 VM01 A virtual machine
- # Or run $Object | Select * to see all properties
- # Id : 1
- # Name : VM01
- # Description : A virtual machine
- # Location : UK
- # IPAddress : 10.0.0.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement