# encoding: ascii
# api: powershell
# title: A Process Block
# description: A Process Block
# version: 0.1
# type: script
# license: CC0
# x-poshcode-id: 1145
# x-archived: 2009-06-07T13:29:24
#
#
Process {
#Get the type of object we have
$InputTypeName = $_.GetType().Name
#Do something with that object
#is it VMware?
if ( $InputTypeName -eq "VMHostImpl" ) {
$output = $_ | Get-View | Select-Object $VMHost_UUID
#is it Xen?
} elseif ($InputTypeName -eq "Host"){
$output = $_ | get-view | Select-Object $XenHost_UUID
#Otherwise throw an error
} else {
Write-Host "`nPlease pass this script either a VMHost or VM object on the pipeline.`n"
}
}