diff --git a/_NDGOV_WindowsTeam/ITD.Infra-VMware.Administration/Scripts/Sync-ITDVMwareVMMetadataToSql.ps1 b/_NDGOV_WindowsTeam/ITD.Infra-VMware.Administration/Scripts/Sync-ITDVMwareVMMetadataToSql.ps1 index 9aadc02..ac8767f 100644 --- a/_NDGOV_WindowsTeam/ITD.Infra-VMware.Administration/Scripts/Sync-ITDVMwareVMMetadataToSql.ps1 +++ b/_NDGOV_WindowsTeam/ITD.Infra-VMware.Administration/Scripts/Sync-ITDVMwareVMMetadataToSql.ps1 @@ -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