Public/Get-bConnectBootEnv.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
Function Get-bConnectBootEnv() {
    <#
        .Synopsis
            Get specified BootEnvironment or a list of all boot environments
        .Parameter BootEnvironmentGuid
            Valid GUID of a boot environment
        .Outputs
            Array of BootEnvironment (see bConnect documentation for more details)
    #>


    Param (
        [string]$BootEnvironmentGuid
    )

    $_connectVersion = Get-bConnectVersion
    If($_connectVersion -ge "1.0") {
        If($BootEnvironmentGuid) {
            $_body = @{
                Id = $BootEnvironmentGuid
            }
        }

        return Invoke-bConnectGet -Controller "BootEnvironment" -Version $_connectVersion -Data $_body
    } else {
        return $false
    }
}