Skip to content

New-HVFarm fails when $maxSessionsType is set to "LIMITED" as it is incorrectly being set in line 2786 #400

Closed
@kchoudhury

Description

@kchoudhury

For vmware.hv.helper module , the function New-HVFarm is incorrectly setting the $maxSessionsType for the $farmspecobject due to which if you pass the $maxSessionsType parameter value to LIMITED the api request sent is incorrect and sets the $maxsession value instead of $maxSessionsType:

Problem lies in line number 2786 -

$farmSpecObj.AutomatedFarmSpec.RdsServerMaxSessionsData.MaxSessionsType = $maxSessionsType
        if ($maxSessionsType -eq "LIMITED") {
            $farmSpecObj.AutomatedFarmSpec.RdsServerMaxSessionsData.MaxSessionsType = $maxSessions
        }

Correct code should be to set MaxSessions in this condition as given below:

$farmSpecObj.AutomatedFarmSpec.RdsServerMaxSessionsData.MaxSessionsType = $maxSessionsType
        if ($maxSessionsType -eq "LIMITED") {
            $farmSpecObj.AutomatedFarmSpec.RdsServerMaxSessionsData.MaxSessions = $maxSessions
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions