PowerCLI: Inventory VM Hardware version


image

With the release of vSphere we also got a new Hardware version of the VM. I created a PowerCLI script to inventory the VM’s, which are not upgraded yet.

Get-VM |% {Get-View $_.ID} |`

% {
$vmVersion = $_.Config.Version
$vmName = $_.Name

    if ($vmVersion -eq "vmx-04"){
        Write-Host $vmName "uses hardware version 4" 
    }
}

Disconnect-VIServer -Confirm:$false


The output will look like this:

image

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s