Functions/Get-AGAccessPackages.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-AGAccessPackages{
<#
    .SYNOPSIS
        Retrieves a list of Access Packages as defined in entitlement management.
 
    .DESCRIPTION
        Retrieves a list of Access Packages as defined in entitlement management.
 
    .EXAMPLE
        Get-AGAccessPackages
 
    .INPUTS
        Input is from command line or called from a script.
 
    .OUTPUTS
        This will output a list of apps from InTune via MS Graph
 
    .NOTES
        Author: Lars Panzerbjørn
        Creation Date: 2021.10.12
         
#>

    [CmdletBinding()]
    $Version = "/beta"
    $URI = $BaseURI + $Version
    $URI = $URI + "/identityGovernance/entitlementManagement/accessPackages"
    
    $InvokeRestMethodSplat = @{
        Headers = $Headers
        Uri = $URI
        Method = "Get"
    }

    $Result = (Invoke-RestMethod @InvokeRestMethodSplat).Value
    Return $Result
}