Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. $Object = [PSCustomObject]@{
  2.  
  3. Id = "1"
  4. Name = "VM01"
  5. Description = "A virtual machine"
  6. Location = "UK"
  7. IPAddress = "10.0.0.1"
  8.  
  9. }
  10.  
  11. $Object.PSObject.TypeNames.Insert(0, "Test.Type")
  12. Update-TypeData -TypeName "Test.Type" -DefaultDisplayPropertySet "Id", "Name", "Description" -Force
  13.  
  14. $Object
  15.  
  16. # Id Name Description
  17. # -- ---- -----------
  18. # 1 VM01 A virtual machine
  19.  
  20.  
  21. # Or run $Object | Select * to see all properties
  22.  
  23. # Id : 1
  24. # Name : VM01
  25. # Description : A virtual machine
  26. # Location : UK
  27. # IPAddress : 10.0.0.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement