Wrapper script that imports a DSvClient-downloaded VMware repository into vCenter in one go. Calls into the DSvRepoImport PowerShell module.
In order, the script:
- Connects to vCenter (both
Connect-VIServerandConnect-CisServer) using one set of API credentials and stores VCSA OS root credentials separately for SSH/SFTP access. Import-VsanHclDatabase— uploadsall.json(vSAN Hardware Compatibility List) via PowerCLI.Import-VsanReleaseCatalog— uploadsresults.json(vSAN release catalog) via the vSAN managed object API.Import-VcgDatabase— uploadsvvs_data.gz(VCG hardware compatibility database) by extracting it locally, SFTPing it to the VCSA and runninghcl_datastore.pyover SSH.- (Optional)
Get-VlcmOfflineBundle | Remove-VlcmOfflineBundle— when run with-CleanupBeforeImport, removes any previously imported depots whose description matchesDSv:*,*metadata*.zipor*-scripts.zip. Off by default to avoid accidentally deleting working depots. Import-VlcmOfflineBundle— repackages every matched depot in the DSv repo into vLCM-importable self-contained bundles and imports each via the offline-depot REST API. Supports all four DSv depot types (main/,addon-main/,iovp-main/,vmtools-main/).- Disconnects from vCenter on exit (success or failure).
VCSA appliance updates (valm/) are not included in this flow because patching the appliance is destructive. Use New-VcsaPatchIso from the module manually when you want to do that.
- Windows PowerShell 5.1
- The DSvRepoImport module installed in
$env:PSModulePath.- Pulls in PowerCLI (
VMware.VimAutomation.Core,VMware.VimAutomation.Cis.Core,VMware.VimAutomation.Storage),WinSCPandPosh-SSHas dependencies.
- Pulls in PowerCLI (
- A DSv repo on disk that includes some or all of:
all.json/results.json/vvs_data.gzmain/,addon-main/,iovp-main/,vmtools-main/depot folders
- Network access to the vCenter API and SSH access to the VCSA root account.
# Install the module first (see ../DSvRepoImport/README.md)
# Drop the script anywhere
Copy-Item .\Import-DSvRepo.ps1 "$env:USERPROFILE\Scripts\"# Import everything
.\Import-DSvRepo.ps1 -VCenterServer vcsa.domain.local -RepoPath "D:\VMware-repo"
# Only ESXi 8.0.3 (any patch level)
.\Import-DSvRepo.ps1 -VCenterServer vcsa.domain.local -RepoPath "D:\VMware-repo" `
-VersionFilter '*8.0.3*'
# Only one specific ESXi build
.\Import-DSvRepo.ps1 -VCenterServer vcsa.domain.local -RepoPath "D:\VMware-repo" `
-VersionFilter '*8.0.3*' -BuildFilter '25205845'
# Combine multiple depot types
.\Import-DSvRepo.ps1 -VCenterServer vcsa.domain.local -RepoPath "D:\VMware-repo" `
-VersionFilter @('*8.0.3*','*8.0-Addon*','*8.0-IOVP*','*8.0-vmtools*')
# Wipe previously imported DSv depots before importing
.\Import-DSvRepo.ps1 -VCenterServer vcsa.domain.local -RepoPath "D:\VMware-repo" `
-VersionFilter '*8.0.3*' -CleanupBeforeImportYou will be prompted for two sets of credentials at startup:
- vCenter API credentials — used by PowerCLI for sections 2, 3, 6 (e.g.
administrator@vsphere.local). - VCSA OS root credentials — used for SSH/SFTP into the appliance for sections 4 and 6.
| Name | Required | Description |
|---|---|---|
VCenterServer |
yes | FQDN or IP of the vCenter Server. |
RepoPath |
yes | Path to the DSv-downloaded VMware-repo root directory. |
VCSAUser |
no | Username for the VCSA OS prompt. Defaults to root. |
VersionFilter |
no | Wildcard pattern(s) matched against metadata.zip filenames. Default '*' (all). |
BuildFilter |
no | Wildcard pattern(s) matched against build numbers within a matched metadata.zip. |
CleanupBeforeImport |
no | Switch. When set, removes all previously imported DSv depots before importing. Off by default. |
- Re-running is safe by default. vLCM internally deduplicates VIBs by content hash, so the same VIB imported twice doesn't waste disk space on the appliance. The script also tracks already-uploaded VIBs across the run to avoid re-uploading them.
- Patches are destructive —
valm/is intentionally NOT imported. Build the ISO withNew-VcsaPatchIsofrom the module and apply it manually viasoftware-packages stage --iso/software-packages install --isofrom the VCSA shell. - Why two credential prompts? The vCenter API user (e.g. an SSO admin) generally cannot SSH into the appliance, and the VCSA root user generally cannot run vSphere API calls. The script needs both.
- No telemetry. No external network calls beyond the vCenter REST API and SSH to the VCSA you specified.
For details on the underlying functions, parameters, the bundle repackaging strategy and per-depot-type behavior, see DSvRepoImport README.