Skip to content

Posts tagged ‘PowerCLI’

31
Aug

VMworld: vSphere PowerCLI Best Practice (VSP1883)

Speakers: Luc Dekens (Eurocontrol), Alan Renouf (VMware)

Luc – blog: http://lucd.info
Alan – blog: http://www.virtu-al.net

BP1: Get-View returns full copy of the server-side object
– otherwise the get- commands only return a subset of the properties

BP2: Finding Properties
– what you see is not what is there
– – can edit the .ps1xml files to change returned properties
– use Get-Member to return all of the properties
– ex. Get-VMHost | Get-Member
– complex (nested) objects
– – Select-Object -ExpandProperties
– – Get-Member in a loop
– – Format-Custom Depth

BP3: Make Your Own Properties
– use the New-VIProperty cmdlet
– adds a CodeProperty to the object
– valid until Remove-VIProperty or end of session

Read moreRead more