Skip to content

Get-GraphAllPages

SYNOPSIS

Retrieve all paginated results from a Microsoft Graph API response.

SYNTAX

Get-GraphAllPages [[-response] <Hashtable>] [<CommonParameters>]

DESCRIPTION

This function processes a paginated Microsoft Graph API response and retrieves all pages of data by following the `@odata.nextLink` property.

EXAMPLES

EXAMPLE 1

$response = Invoke-GraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/users"

PS C:\> $allUsers = $response | Get-GraphAllPages Retrieves all user data from the Microsoft Graph API, including paginated results.

EXAMPLE 2

$response = Invoke-GraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/groups"

PS C:\> $allGroups = $response | Get-GraphAllPages Retrieves all group data from the Microsoft Graph API, including paginated results.

PARAMETERS

-response

The initial response from a Microsoft Graph API request. This should include the `@odata.nextLink` property if pagination is required.

Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
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