This commit is contained in:
Zack Meier
2026-04-21 09:37:26 -05:00
parent 6c5aa8fd79
commit 90667af3ab
@@ -119,7 +119,7 @@ Write-Verbose "Gathering VMs"
# Include ALL VMs (SRM placeholders flagged via column, not excluded). # Include ALL VMs (SRM placeholders flagged via column, not excluded).
# vCLS agent VMs are excluded -- they are vSphere internal and not customer workloads. # vCLS agent VMs are excluded -- they are vSphere internal and not customer workloads.
$AllVMs = Get-VM | Where-Object { $_.Name -notlike 'vCLS*' } $AllVMs = Get-VM | Where-Object { $_.Name -notlike 'vCLS*' } | Sort-Object -Property Name
#--- Pre-fetch all tag assignments in one API call (avoids per-VM Get-TagAssignment) #--- Pre-fetch all tag assignments in one API call (avoids per-VM Get-TagAssignment)
Write-Verbose 'Pre-fetching VM tag assignments...' Write-Verbose 'Pre-fetching VM tag assignments...'
@@ -139,6 +139,9 @@ Get-TagAssignment -Entity $AllVMs | ForEach-Object {
Write-Verbose "Processing $($AllVMs.Count) VMs..." Write-Verbose "Processing $($AllVMs.Count) VMs..."
$Results = foreach ($VM in $AllVMs) { $Results = foreach ($VM in $AllVMs) {
Write-Verbose -Message ("Start " + $VM.Name) -Verbose
$StoragePlatforms = $null
$StoragePlatform = $null
$Ext = $VM.ExtensionData # single API object -- reuse for all fields $Ext = $VM.ExtensionData # single API object -- reuse for all fields