Try something like this
Get-VM |
where{$_.Guest.GuestFamily -match 'linux' -and $_.Guest.ExtensionData.ToolsStatus -eq 'toolsOld'} |
Select Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
"$_.Guest.GuestFamily -match 'linux'" its not returning anything
tried with Guest.GuestFullName as well; no avail.
Get-VM | where{$_.Guest.ExtensionData.ToolsStatus -eq 'toolsOld'} returns list of all VMs with outdated/old tools
And what do your Linux VMs display for the GuestFamily and GuestFullname ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
This is exactly what I am trying....
Get-Cluster "CLUSTER" | Get-VM | where{$_.Guest.GuestFamily -match 'linux'} or
Get-Cluster "CLUSTER" | Get-VM | where{$_.Guest.GuestFullName -match 'linux'}
result is Blank
I ment, what do you see when you do this
Get-VM | Select Name,@{N='Family';E={$_.Guest.GuestFamily}},
@{N='OS';E={$_.Guest.OSFullName}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It lists the VMs with Name, Family and OS
Name and OS are good but the Family column is blank
Provided the OS name contains the work "linux" you could do something like this
Get-VM |
where{$_.Guest.OSFullName -match 'linux' -and $_.Guest.ExtensionData.ToolsStatus -eq 'toolsOld'} |
Select Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank You; I get a listing of linux VMs which need tools update
is it possible to get a column with "Tools Status" and "Guest OS" as well?
Sure, something like this
Get-VM |
where{$_.Guest.OSFullName -match 'linux' -and $_.Guest.ExtensionData.ToolsStatus -eq 'toolsOld'} |
Select Name,@{N='OS';E={$_.Guest.OSFullName}},
@{N='Tools Status';E={$_.Guest.ExtensionData.ToolsStatus}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yay!!!
one last thing
I only get Out of Date / toolsOld under status, can i also get 'tools not installed' VMs as well?
Sure, try like this
Get-VM |
where{$_.Guest.OSFullName -match 'linux' -and 'toolsOld','toolsNotInstalled' -contains $_.Guest.ExtensionData.ToolsStatus} |
Select Name,@{N='OS';E={$_.Guest.OSFullName}},
@{N='Tools Status';E={$_.Guest.ExtensionData.ToolsStatus}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference