Imagine you feel like reinstalling your vCAC system as the DB got somehow corrupted and VMware support is not able to fix it. Although you really like the fancy GUI of the vCAC administration interface you somehow get bored to enter all your configuration options again and again … As usual, there is help:
PS > $File = 'C:\data\Export-PropertyDefinitions.xml'; PS > $m.GetType().FullName; DynamicOps.ManagementModel.ManagementModelEntities PS > foreach($pd in $m.PropertyDefinitions) { ($pd|gm -Type Property).Name |% { $null = $m.LoadProperty($pd, $_); } } # foreach PS > $apd = $m.PropertyDefinitions; PS > $apd | Export-Clixml $File;
You can later import them via API again (or just use one of the handy wrappers in our ‘biz.dfch.PS.vCAC.Utilities’ module):
PS > $apd = Import-Clixml $File; PS > foreach($pd in $apd) { New-VcacPropertyDefinition -Name $pd.PropertyName -Value $pd.PropertyValue -DisplayName $pd.DisplayName -Description $pd.FullDescription -Type $pd.ControlTypeName -IsHidden:$pd.IsHidden -IsRuntime:$pd.IsRuntime -IsEncrypted:$pd.IsEncrypted -IsRequired:$pd.IsRequired ; } # foreach
Needless to mention that you can do this with nearly any entity in vCAC you like…