Request-DirectoryRole
SYNOPSIS
Requests directory roles from Microsoft Graph. Caches in global variable.
SYNTAX
Request-DirectoryRole [-Cached] [-Test] [[-Xml] <Boolean>] [[-Return] <String>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Internal helper. Fetches all Entra ID directory roles (with their members) from Microsoft Graph and caches the result in a session-scoped global variable. Subsequent callers that pass -Cached skip the API call and read from the cache. Used by Get-AdminRole and the incident response playbook to avoid redundant Graph requests.
EXAMPLES
Example 1
PS C:\> {{ Add example code here }}
{{ Add example description here }}
PARAMETERS
-Cached
{{ Fill Cached Description }}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Test
{{ Fill Test Description }}
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Xml
{{ Fill Xml Description }}
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: $Global:IRT_Config.ExportXml
Accept pipeline input: False
Accept wildcard characters: False
-Return
{{ Fill Return Description }}
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: Objects
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
Version: 2.0.0