Yes, you can, but you will need to use the API method.
Something like this for example
$dcName = 'MyDC'$clusterName = 'TestCluster'
$ruleName = 'Rule1'
$vmGroupName = 'VmGroup1'
$hostGroupName = 'HostGroup1'
$dc = Get-Datacenter -Name $dcName
$cluster = New-Cluster -Name $clusterName -Location $dc -DrsMode FullyAutomated -DrsEnabled -HAEnabled
$spec = New-Object VMware.Vim.ClusterConfigSpecEx
$groupVM = New-Object VMware.Vim.ClusterGroupSpec
$groupVM.Info = New-Object VMware.Vim.ClusterVmGroup
$groupVM.Info.Name = $vmGroupName
$spec.GroupSpec += $groupVM
$groupHost = New-Object VMware.Vim.ClusterGroupSpec
$groupHost.Info = new-object VMware.Vim.ClusterHostGroup
$groupHost.Info.Name = $hostGroupName
$spec.GroupSpec += $groupHost
$rule = New-Object VMware.Vim.ClusterRuleSpec
$rule.Operation = [VMware.Vim.ArrayUpdateOperation]::add
$rule.Info = New-Object VMware.Vim.ClusterVmHostRuleInfo
$rule.Info.Name = $ruleName
$spec.RulesSpec += $rule
$cluster.ExtensionData.ReconfigureComputeResource($spec, $true)
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.