Private/Get-DMPortGroupCandidate.ps1

function Get-DMPortGroupCandidate {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory = $true)]
        [pscustomobject]$WebSession,

        [Parameter(Mandatory = $true)]
        [ValidateSet('FibreChannel', 'Ethernet', 'LogicalPort')]
        [string]$PortType
    )

    switch ($PortType) {
        'FibreChannel' {
            @(Get-DMPortFc -WebSession $WebSession) | ForEach-Object {
                [pscustomobject]@{ Id = $_.Id; Name = $_.Name; ObjectType = 212 }
            }
        }
        'Ethernet' {
            @(Get-DMPortETH -WebSession $WebSession) | ForEach-Object {
                [pscustomobject]@{ Id = $_.Id; Name = $_.Name; ObjectType = 213 }
            }
        }
        'LogicalPort' {
            @(Get-DMLif -WebSession $WebSession) | ForEach-Object {
                [pscustomobject]@{ Id = $_.Id; Name = $_.'LIF Name'; ObjectType = 279 }
            }
        }
    }
}