This commit is contained in:
Zack Meier
2026-04-15 15:42:41 -05:00
parent 74edcc4d9a
commit 03dba08135
146 changed files with 9119 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
$SQLVMs = (Get-ITDVMwareSharePointVMGuestList | Where-Object { $_.LicensingRestrictions -like "*SQL*" -and $_.Status -ne "Deleted" }).Title | Sort-object
$result = [System.Collections.ArrayList]@()
ForEach ($SQLVM in $SQLVMs) {
$VM = $null
$Disks = $null
$PersistentDisks = $null
$IndPersistentDisks = $null
$VM = Get-VM -Name $SQLVM | Where-Object { $_.ExtensionData.summary.config.ManagedBy.Type -ne "placeholderVm" }
If ($VM) {
$Disks = $vm | Get-HardDisk
$PersistentDisks = $Disks | where-object Persistence -eq Persistent
$IndPersistentDisks = $Disks | Where-Object Persistence -eq IndependentPersistent
$obj = [PSCustomObject]@{
'Name' = $VM.Name;
'DisksPersistentCount' = @($PersistentDisks).count
'DisksPersistentSizeGB' = ($PersistentDisks | measure-object -Sum CapacityGB).Sum
'DisksIndPersistentCount' = @($IndPersistentDisks).count
'DisksIndPersistentSizeGB' = ($IndPersistentDisks | measure-object -Sum CapacityGB).Sum
}
$null = $result.Add($obj)
}
}