I have the below script that get's me data... $result = @() $vms = Get-view -ViewType VirtualMachine foreach ($vm in $vms) { if($vm.config.hardware.NumCoresPerSocket -ne $null){ ...
See more...
I have the below script that get's me data... $result = @() $vms = Get-view -ViewType VirtualMachine foreach ($vm in $vms) { if($vm.config.hardware.NumCoresPerSocket -ne $null){ $cores = $vm.config.hardware.NumCoresPerSocket } else{ $cores = 1 } $obj = new-object psobject $obj | Add-Member -MemberType NoteProperty -Name ServerName -Value ($vm.Name) $obj | Add-Member -MemberType NoteProperty -Name CPUs -Value ($vm.config.hardware.NumCPU) $obj | Add-Member -MemberType NoteProperty -Name Sockets -Value ($vm.config.hardware.NumCPU/$cores) $obj | Add-Member -MemberType NoteProperty -Name CPUPersocket -Value $cores $obj | Add-Member -MemberType NoteProperty -Name RAMAssigned -Value ([math]::Round($vm.Config.Hardware.MemoryMB/1KB)) $obj | Add-Member -MemberType NoteProperty -Name OSProfile -Value $vm.Config.GuestFullName $result += $obj } #$result | Out-File c:\temp\cputest.txt $result | Export-Csv -Path c:\temp\cputest.txt -NoTypeInformation It works and gets me data for every VM. Below is a sample.... "ServerName","CPUs","Sockets","CPUPersocket","RAMAssigned","OSProfile" "goofy","2","2","1","6","Microsoft Windows Server 2012 (64-bit)" "pluto","3","3","1","12","Microsoft Windows Server 2012 (64-bit)" "donaldduck","4","2","2","16","Microsoft Windows Server 2012 (64-bit)" How can I point it to a specific VM folder called "Disneyland"?