New-IdleAuthSession
SYNOPSIS
Creates a simple AuthSessionBroker for use with IdLE providers.
SYNTAX
New-IdleAuthSession [[-SessionMap] <Hashtable>] [[-DefaultAuthSession] <Object>] [[-AuthSessionType] <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Creates an AuthSessionBroker that routes authentication based on user-defined options. The broker is used by steps to acquire credentials at runtime without embedding secrets in workflows or provider construction.
This is a thin wrapper that delegates to IdLE.Core\New-IdleAuthSessionBroker.
EXAMPLES
EXAMPLE 1
# Simple broker with single credential
$authSessionBroker = New-IdleAuthSession -DefaultAuthSession $credential -AuthSessionType 'Credential'
EXAMPLE 2
# Mixed-type broker for AD + EXO
$authSessionBroker = New-IdleAuthSession -SessionMap @{
@{ AuthSessionName = 'AD' } = @{ AuthSessionType = 'Credential'; Credential = $adCred }
@{ AuthSessionName = 'EXO' } = @{ AuthSessionType = 'OAuth'; Credential = $token }
}
PARAMETERS
-SessionMap
A hashtable that maps session configurations to auth sessions.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DefaultAuthSession
Optional default auth session to return when no session options are provided.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-AuthSessionType
Optional default authentication session type. When provided, allows simple (untyped) session values. When not provided, values must be typed descriptors.
Valid values:
- 'OAuth': Token-based authentication (e.g., Microsoft Graph, Exchange Online)
- 'PSRemoting': PowerShell remoting execution context (e.g., Entra Connect)
- 'Credential': Credential-based authentication (e.g., Active Directory, mock providers)
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
TODO: ProgressAction Description
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
PSCustomObject with AcquireAuthSession method
NOTES
For detailed documentation, see: Get-Help IdLE.Core\New-IdleAuthSessionBroker -Full