Public/Get-bConnectHardwareProfile.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-bConnectHardwareProfile() {
    <#
        .Synopsis
            Get specified HardwareProfile or a list of all hardware profiles
        .Parameter HardwareProfileGuid
            Valid GUID of a hardware profile
        .Outputs
            Array of HardwareProfile (see bConnect documentation for more details)
    #>


    Param (
        [string]$HardwareProfileGuid
    )

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

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