#Get-VMHostの比較 $oldinv = Import-Clixml .\HyperVHost-Inventory-コンピューター名-XXXXXX-XXXXXX.xml $newinv = Import-Clixml .\HyperVHost-Inventory-コンピューター名-YYYYYY-YYYYYY.xml $oldVMhost = $oldinv.HyperV.VMHost $newVMHost = $newinv.HyperV.VMHost $properties = $oldVMhost.PSObject.Properties.name foreach ($property in $properties) { $oldValue = $oldVMHost.$property $newValue = $newVMHost.$property $oldText = if ($null -eq $oldValue) { $null } else { $oldValue.ToString() } $newText = if ($null -eq $newValue) { $null } else { $newValue.ToString() } if ($oldText -ne $newText) { [pscustomobject]@{ Property = $property OldValue = $oldText NewValue = $newText } } }