update
This commit is contained in:
+4
-1
@@ -119,7 +119,7 @@ Write-Verbose "Gathering VMs"
|
||||
|
||||
# Include ALL VMs (SRM placeholders flagged via column, not excluded).
|
||||
# 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)
|
||||
Write-Verbose 'Pre-fetching VM tag assignments...'
|
||||
@@ -139,6 +139,9 @@ Get-TagAssignment -Entity $AllVMs | ForEach-Object {
|
||||
Write-Verbose "Processing $($AllVMs.Count) VMs..."
|
||||
|
||||
$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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user