Testing Virtual Machine Hosts

Tests the existence of the specified Virtual Machine Host object(s). Returns true, if the Virtual Machine Host exists and false if it doesn't.


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


The following example tests, if the Virtual Machine Host "HYP-V01" exists in "Managed Virtual Environments\Hyper-V\Hosts":


Test-EmdbVirtualHost "emdb:\rootDSE\Managed Virtual Environments\Hyper-V\Hosts\HYP-V01"


The command below checks, if a Virtual Machine Host having a name starting with "HYP-" exists in "Managed Virtual Environments\Hyper-V\Hosts":


Test-EmdbVirtualHost "emdb:\rootDSE\Managed Virtual Environments\Hyper-V\Hosts\HYP-*"


This cmdlet tests, if there is at least one Virtual Machine Host object underneath "Managed Virtual Environments":


Test-EmdbVirtualHost "emdb:\rootDSE\Managed Virtual Environments\*" -Recurse