Friday, October 10, 2025
HomePowershellListing and doc all Hyper-V VMs with crucial properties – SID-500.COM

Listing and doc all Hyper-V VMs with crucial properties – SID-500.COM


PowerShell

So you will have a number of Hyper-V VMs and will have misplaced monitor of them. On this submit I’ll present you the way to retrieve all Hyper-V VMs with crucial properties and settings. With PowerShell in fact – what else.

Run this little good script to get crucial properties of your VMs.

Get-VM | Choose-Object Title,ProcessorCount,`
@{identify="MemoryStartup";expression={[math]::Spherical($_.MemoryStartup/1GB,0).tostring() + ' GB'}},`
@{identify="MemoryAssigned";expression={[math]::Spherical($_.MemoryAssigned/1GB,0).tostring() + ' GB'}},`
@{n='Uptime';e={(Get-Date) - $_.Uptime}},State,Model | Format-Desk

Now you will have a pleasant overview of your VMs.

By the best way, you may in fact save the output to a file.

Get-VM | Choose-Object Title,ProcessorCount,`
@{identify="MemoryStartup";expression={[math]::Spherical($_.MemoryStartup/1GB,0).tostring() + ' GB'}},`
@{identify="MemoryAssigned";expression={[math]::Spherical($_.MemoryAssigned/1GB,0).tostring() + ' GB'}},`
@{n='Uptime';e={(Get-Date) - $_.Uptime}},State,Model | Convertto-HTML | Out-File $homevms.html

Printed by Patrick Gruenauer

Microsoft MVP on PowerShell [2018-2023], IT-Coach, IT-Advisor, MCSE: Cloud Platform and Infrastructure, Cisco Licensed Academy Teacher.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments