Public/Disconnect-IBCLI.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function Disconnect-IBCLI
{
    [CmdletBinding()]
    param(
        [Parameter(
            Mandatory=$true,
            Position=1,
            HelpMessage='Enter the ShellStream object returned by Connect-IBCLI.'
        )]
        [ValidateNotNull()]
        [Renci.SshNet.ShellStream]
        $ShellStream
    )

    $id = $ShellStream.SessionId
    $ShellStream.Dispose()

    Write-Verbose "Disconnecting from SSH session $id"
    Remove-SSHSession -SessionId $id | Out-Null



    <#
    .SYNOPSIS
        Disconnect from an Infoblox remote console.
 
    .DESCRIPTION
        Disconnect from an SSH session to an Infoblox appliance's remote console.
 
    .PARAMETER ShellStream
        A Renci.SshNet.ShellStream object that was returned from Connect-IBCLI.
 
    .EXAMPLE
        Disconnect-IBCLI $stream
 
        Disconnect from an appliance using a previously retrieved stream object.
 
    .LINK
        Project: https://github.com/rmbolger/Posh-IBCLI
 
    .LINK
        Connect-IBCLI
 
    #>

}