Export API Properties XML PowerCLI

Export with PowerCLI all API properties of any VMware object as a XML file.

Have you ever wished to extract all properties available for any VMware object through the API?
For example for a HostSystem, ClusterComputeResource or a DistributedVirtualSwitch?

This is the purpose of the script presented in this post.

Examples of files generated:
DistributedVirtualSwitch
DistributedVirtualSwitch

HostSystem
HostSystem
Note:
The files above have been opened with XML Notepad

The script:
Function Export-VMware_API_Properties_XML

How to export all properties of a HostSystem:

Connect-VIServer -Server "10.0.0.8" -User "administrator@vsphere.local" -Password "MyL@b0123"
$ObjectToAnalyse = (get-vmhost "10.0.0.11").extensiondata
$PropertyToExclude = @()
Export-VMware_API_Properties_XML -ToAnalyse $ObjectToAnalyse -PropertyToExclude $PropertyToExclude -Path 'C:\Temp\10.0.0.11_API_Properties.xml'
DIsconnect-VIServer -Server "10.0.0.8" -confirm:$False

Tested in a home lab with:
Windows 8.1
PowerCLI Release 6.0 Release 1
vCenter Server 6.0.0 2559267

This script is still in beta version.
Please let me know if you have any comments, bugs to report, or feature requests.

Leave a Reply

Your email address will not be published.