Private/Set-IBSession.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function Set-IBSession {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory=$true)]
        [uri]$Uri,
        [Parameter(Mandatory=$true)]
        [pscredential]$Credential,
        [Parameter(Mandatory=$true)]
        [Microsoft.PowerShell.Commands.WebRequestSession]$WebSession
    )

    $script:Sessions."$($Uri.Authority)|$($Credential.Username)" = $WebSession
}