Skip to content

Get CosmosDbContinuationToken

Daniel Scott-Raynsford edited this page May 31, 2022 · 2 revisions

external help file: CosmosDB-help.xml Module Name: CosmosDB online version: schema: 2.0.0

Get-CosmosDbContinuationToken

SYNOPSIS

Return the continuation token from a response header object.

SYNTAX

Get-CosmosDbContinuationToken [-ResponseHeader] <Object> [<CommonParameters>]

DESCRIPTION

This function takes a response header object that is generated by the ResponseHeader reference parameter in the Get-CosmosDbCollection or Get-CosmosDbDocument functions and returns the continuation token that is found in the 'x-ms-continuation' header.

The continuation token can then be passed back into the Get-CosmosDbCollection or Get-CosmosDbDocument functions to continue to return records.

If the 'x-ms-continuation' header is missing or empty in the ResponseHeader then an exception will be thrown.

EXAMPLES

Example 1

PS C:\> $ResponseHeader = $null
PS C:\> $documents = Get-CosmosDbDocument -Context $cosmosDbContext -CollectionId 'MyNewCollection' -MaxItemCount 5 -ResponseHeader ([ref] $ResponseHeader)
PS C:\> $continuationToken = Get-CosmosDbContinuationToken -ResponseHeader $ResponseHeader

Return the continuation token from the Get-CosmosDbDocument response headers.

PARAMETERS

-ResponseHeader

The Response Header object generated by Get-CosmosDbCollection or Get-CosmosDbDocument functions.

Type: Object
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
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

None

OUTPUTS

System.String

NOTES

RELATED LINKS

CosmosDB Cmdlets

Clone this wiki locally