Here is a quick set of scripts to export and backup your VDswitches. It is pretty straight forwards. It dumps VDswitch exports with and without port groups and the VDportgroups into their own folders. Then zip up each folder and finally create an archive from that 3 folders into a single backup zip. You can delete the folders and the other zip files after it ran successfully
#first connect to your vcenter with linked mode if you have New-Item -Name noportgroup_vdswitch -ItemType Directory Get-VDSwitch | % {Export-VDSwitch -VDSwitch $_ -Destination ".\noportgroup_vdswitch\NoPort_$($_.datacenter)_$($_.name)_$($_.id).zip" -WithoutPortGroups } Compress-Archive -Path .\noportgroup_vdswitch -DestinationPath .\noportgroup_vdswitch New-Item -Name fullportgroup_vdswitch -ItemType Directory Get-VDSwitch | % {Export-VDSwitch -VDSwitch $_ -Destination ".\fullportgroup_vdswitch\fullport_$($_.datacenter)_$($_.name)_$($_.id).zip" } Compress-Archive -Path .\fullportgroup_vdswitch -DestinationPath .\fullportgroup_vdswitch New-Item -Name vdportgroup -ItemType Directory Get-VDPortgroup | % { Export-VDPortGroup -VDPortGroup $_ -Destination ".\vdportgroup\PG_$($_.datacenter)_$($_.vdswitch)_$($_.name)_$($_.id).zip" } Compress-Archive -Path .\vdportgroup -DestinationPath .\vdportgroup Compress-Archive -LiteralPath .\vdportgroup.zip,.\fullportgroup_vdswitch.zip,.\noportgroup_vdswitch.zip -DestinationPath .\vdswitch_backup_$($(date).tostring("yyyyMMdd"))