pamiller21
Enthusiast
Enthusiast

Hardware Version Report

Jump to solution

I need to update my hardware report for the newest version, 18.  But its showing all v18 VMs as unknown.

$report = Get-VM | where { $_.ExtensionData.Config.Version -notmatch "vmx-18" } | Select Name, Version

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Something like this you mean?

(Get-VM | where{$_.EXtensionData.Config.Version -ne 'vmx-18'}).Count


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership

The vmx-18 is not yet supported by PowerCLI, but you can use the ExtensionData.
Something like this for example

Get-VM | Group-Object -Property {$_.EXtensionData.Config.Version}

For each group, you can then list the VMs.
Like this for example

Get-VM | 
Group-Object -Property {$_.EXtensionData.COnfig.Version} -PipelineVariable group |
ForEach-Object -Process {
    New-Object -TypeName PSObject -Property ([ordered]@{
        HWVersion = $group.Name -replace 'vmx-',''
        VM = $group.Group.Name -join ','
    })
}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
pamiller21
Enthusiast
Enthusiast

The report I look at shows how many VMs are not version 18, is there anyway to do that?

0 Kudos
LucD
Leadership
Leadership

Something like this you mean?

(Get-VM | where{$_.EXtensionData.Config.Version -ne 'vmx-18'}).Count


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos