A quick useful vcheck for number of disks allocated to a VM , number of NICs and Guest OS details
New-VIProperty -ObjectType VirtualMachine -Name CommittedSpaceMB -Value { $vm = $args[0]; $sum = 0; $vm.ExtensionData.Storage.PerDatastoreUsage | foreach { $sum += $_.Committed} ; $sum = [int]($sum / 1024 / 1024); return $sum }
Get-VM | select Name,@{N=’vDisk’;E={($_.ExtensionData.Config.Hardware.Device | ? {$_ -is [VMware.Vim.VirtualDisk]}).Count}},@{N=’vNIC’;E={($_.ExtensionData.Config.Hardware.Device | ?{$_ -is [VMware.Vim.VirtualEthernetCard]}).Count}}, Guest, NumCpu, CoresPerSocket, MemoryGB, ResourcePool, CommittedSpaceMB | ft -a
New-VIProperty -ObjectType VirtualMachine -Name CommittedSpaceMB -Value { $vm = $args[0]; $sum = 0; $vm.ExtensionData.Storage.PerDatastoreUsage | foreach { $sum += $_.Committed} ; $sum = [int]($sum / 1024 / 1024); return $sum }
Get-VM | select Name,@{N=’vDisk’;E={($_.ExtensionData.Config.Hardware.Device | ? {$_ -is [VMware.Vim.VirtualDisk]}).Count}},@{N=’vNIC’;E={($_.ExtensionData.Config.Hardware.Device | ?{$_ -is [VMware.Vim.VirtualEthernetCard]}).Count}}, Guest, NumCpu, CoresPerSocket, MemoryGB, ResourcePool, CommittedSpaceMB | ft -a