PowerCLIGoodies / DRSRule

PowerShell module with support for managing vSphere DRS Rules and Groups
29 stars 9 forks source link

Error at addition in empty group the VM list #12

Closed SVGV closed 6 years ago

SVGV commented 7 years ago

At addition in empty group the VM list

Set-DrsVMGroup -Name $vmDRSgroup -Append -VM $CNVMlist.Name -Cluster $cluster
Compare-Object : Cannot bind argument to parameter 'ReferenceObject' because it is null.
At C:\Program Files (x86)\WindowsPowerShell\Modules\DRSRule\DRSRule.psm1:1088 char:60
+         elseif ($null -eq (Compare-Object -ReferenceObject $arrOriginalVMIDsInTa ...
+                                                            ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Compare-Object], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObjectCommand
PS C:\> $vmDRSgroup
xx-NK

PS C:\> $CNVMlist.Name
89-NK-SQL02
77-NK-APP03
15-NK-TRM02
89-NK-PRN01
16-NK-1C03
SVGV commented 7 years ago

Such mistake appears when in the xx-NK group there are no VM. when add one VM everything begins to work correctly