Public/Get-bConnectAppIcon.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
Function Get-bConnectAppIcon() {
    <#
        .Synopsis
            Get the icon for specified app or all apps within a scope.
        .Parameter AppGuid
            Valid GUID of a app.
        .Parameter Scope
            Valid scope (App/Inventory).
        .Outputs
            Array of Icon (see bConnect documentation for more details).
    #>


    Param (
        [string]$AppGuid,
        [string]$Scope
    )

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

        If($AppGuid) {
            $_body = @{
                AppId = $AppGuid
            }
        }

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