Public/Reset-bConnect.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Function Reset-bConnect() {
    <#
        .Synopsis
            Resets PS-bConnect to not initialized.
    #>


    [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')]
    [OutputType("System.Boolean")]
    Param()

    if($PSCmdlet.ShouldProcess($_body.Id, "Start job instance.")){
        If($script:_defaultCertPolicy) {
            # Reset certicate validation
            [System.Net.ServicePointManager]::CertificatePolicy = $script:_defaultCertPolicy
        }

        $_uri = $null

        $script:_bConnectInfo = $null
        $script:_connectUri = $_uri
        $script:_connectCredentials = $null
        $script:_connectInitialized = $false
    }
}