Skip to content

Commit

Permalink
fix WhatIf and Verbose output for New-DrsVMToVMHostRule (was reversed…
Browse files Browse the repository at this point in the history
…, as reported in issue PowerCLIGoodies#10)
  • Loading branch information
mtboren authored and gpduck committed Apr 26, 2018
1 parent db6af93 commit 9b9e4c9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion DRSRule.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,4 @@

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}
2 changes: 1 addition & 1 deletion DRSRule.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ Function New-DrsVMToVMHostRule {
if ($null -eq (Get-DrsVMHostGroup -Cluster $oThisCluster -Name $strDrsVMHostGroupNameToCheck)) {Throw "No DrsVMHostGroup named '$strDrsVMHostGroupNameToCheck' in cluster '$($oThisCluster.Name)'. Valid group name?"}
else {Write-Verbose "DrsVMHostGroup '$strDrsVMHostGroupNameToCheck' found in cluster '$($oThisCluster.Name)'"}

if($psCmdlet.ShouldProcess("$($oThisCluster.Name)","Create $(if ([String]::IsNullOrEmpty(${AffineHostGroupName})) {'AffineVMToVMHost'} else {'AntiAffineVMToVMHost'}) DRS rule '${Name}'")) {
if($psCmdlet.ShouldProcess("$($oThisCluster.Name)","Create $(if ([String]::IsNullOrEmpty(${AffineHostGroupName})) {'AntiAffineVMToVMHost'} else {'AffineVMToVMHost'}) DRS rule '${Name}'")) {
$spec = New-Object VMware.Vim.ClusterConfigSpecEx

$newRule = New-Object VMware.Vim.ClusterVmHostRuleInfo
Expand Down

0 comments on commit 9b9e4c9

Please sign in to comment.