Compare hostname of VM with display name of VM

Compare hostname of VM with display name of VM

$VMs = Get-VM
foreach ($VM in $VMs){
	$VM = Get-View $VM.ID
	$nm = $VM.name
    $hn = $VM.guest.hostname 
    $vm | select @{Name = "Name"; Expression = {$nm}}, @{Name = "Hostname"; Expression = {$hn}}
    }

http://www.vmwarescripting.com

This document was generated from the following thread: 

Version history
Revision #:
1 of 1
Last update:
‎02-10-2009 06:30 AM
Updated by: