Need to Get-vm Guest OS information

This post was originally published on this site

Need only non windows VMs information, in below scrip i am able to get the VM name and OS information. but in same script i need to get CPU, Memory and Total disksize of the VM. Can  anyone help it out.



Header 1 Header 2 Header 3 Header 4 Header 5 Header 6
Name Configured OS” Running OS CPU mEMORY total Disk SIZE

Get-VM |

where{$_.PowerState -eq ‘PoweredOn’ -and $_.Guest.OSFullName -Notmatch ‘Windows’} |

Select Name,

    @{N=”Configured OS”;E={$_.ExtensionData.Config.GuestFullname}},

    @{N=”Running OS”;E={$_.Guest.OsFullName}},

    @{N=”Powered On”;E={ $_.PowerState -eq “PoweredOn”}} |

Export-Csv redhatVM-allVC.csv -NoTypeInformation -UseCulture


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.