I apologies if the question is not quite right, as I'm not sure of the correct wording / syntax for this question...
Get-View -ViewType VirtualMachine | Where { $_.Guest.GuestFullname} | Sort Name |Select-Object Name, @{N=”SelectedOS”;E={$_.Guest.GuestFullName}}, @{N=”InstalledOS”;E={$_.Summary.Config.GuestFullName}} | Out-GridView
How would I compare and match the data of "SelectedOS" and "InstalledOS" to be output.
So for example the current script would output:
Name SelectedOS InstalledOS
---- ---------- -----------
VM-Demo-CCMIVR-1 Microsoft Windows Server 2012 (64-bit) Microsoft Windows Server 2012 (64-bit)
VM-Demo-vMCD2 Other 2.6.x Linux (32-bit) CentOS 4/5/6 (32-bit)
VM-Inf-CUC-10-5 Red Hat Enterprise Linux 6 (64-bit) Red Hat Enterprise Linux 6 (64-bit)
VM-Inf-CUCM-10-5 Red Hat Enterprise Linux 6 (64-bit) Red Hat Enterprise Linux 6 (64-bit)
VM-Inf-DC01 Microsoft Windows Server 2012 (64-bit) Microsoft Windows Server 2012 (64-bit)
However i only want to see:
Name SelectedOS InstalledOS
---- ---------- -----------
VM-Demo-CCMIVR-1 Microsoft Windows Server 2012 (64-bit) Microsoft Windows Server 2012 (64-bit)
VM-Inf-CUC-10-5 Red Hat Enterprise Linux 6 (64-bit) Red Hat Enterprise Linux 6 (64-bit)
VM-Inf-CUCM-10-5 Red Hat Enterprise Linux 6 (64-bit) Red Hat Enterprise Linux 6 (64-bit)
VM-Inf-DC01 Microsoft Windows Server 2012 (64-bit) Microsoft Windows Server 2012 (64-bit)