PowerCLI VM Power state with wildcard suffix

PowerCLI VM Power state with wildcard suffix

You want to find the power state for a list of VMs, but do not want to add a * at the end of each VM name to find VM names that have suffixes in vCenter vs DNS.

Since “V” was provided, you can see ALL of the VMs that start with V. “fake” was not found (correct). The win2012-disk-test was found and reported powered off.

The Ask

You want to find the power state for a list of VMs, but do not want to add a * at the end of each VM name to find VM names that have suffixes in vCenter vs DNS.

Since “V” was provided, you can see ALL of the VMs that start with V. “fake” was not found (correct). The win2012-disk-test was found and reported powered off.

PowerCLI Script

[crayon-61092168f0885831001678/]

Menu