Skip to content

Commit d5646b6

Browse files
author
William Lam
committed
Function to list supported VM VirtualHW & Config
1 parent 393e030 commit d5646b6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Function Get-VMHardwareVersion {
3+
param(
4+
[Parameter(Mandatory=$true)][String]$ClusterName
5+
)
6+
7+
$cluster = Get-Cluster $ClusterName
8+
$envBrowser = Get-View $cluster.ExtensionData.EnvironmentBrowser
9+
10+
$envBrowser.QueryConfigOptionDescriptor().key
11+
}
12+
13+
Function Get-VMHardwareConfig {
14+
param(
15+
[Parameter(Mandatory=$true)][String]$ClusterName,
16+
[Parameter(Mandatory=$true)][String]$VMHardwareVersion
17+
)
18+
19+
$cluster = Get-Cluster $ClusterName
20+
$vmhost = $cluster | Get-VMHost | select -First 1
21+
$envBrowser = Get-View $cluster.ExtensionData.EnvironmentBrowser
22+
23+
$vmHardwareConfigs = $envBrowser.QueryConfigOption($VMHardwareVersion,$vmhost.ExtensionData.MoRef)
24+
$vmHardwareConfigs.GuestOSDescriptor
25+
}

0 commit comments

Comments
 (0)