Set-MgRequestContext
Sets request context for Microsoft Graph invocations
Syntax
__AllParameterSets
Set-MgRequestContext
[-RetryDelay <int>]
[-MaxRetry <int>]
[-RetriesTimeLimit <int>]
[-ClientTimeout <int>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Sets request context for Microsoft Graph invocations
Examples
Set Http client timeout in seconds
PS C:> Set-MgRequestContext -ClientTimeout 5 ClientTimeout RetryDelay MaxRetry RetriesTimeLimit
00:00:05 3 2 00:00:00
Sets Http client timeout in seconds.
Set the maximum time in seconds allowed for request retries
PS C:> Set-MgRequestContext -RetriesTimeLimit 2 ClientTimeout RetryDelay MaxRetry RetriesTimeLimit
00:00:05 3 2 00:00:02
Sets the maximum time in seconds allowed for request retries.
Set the maximum number of retries for a request
PS C:> Set-MgRequestContext -MaxRetry 2 ClientTimeout RetryDelay MaxRetry RetriesTimeLimit
00:00:05 3 2 00:00:02
Sets the maximum number of retries for a request.
Set the waiting time in seconds before retrying a request
PS C:> Set-MgRequestContext -RetryDelay 3 ClientTimeout RetryDelay MaxRetry RetriesTimeLimit
00:00:05 3 2 00:00:02
Sets the waiting time in seconds before retrying a request.
Parameters
-ClientTimeout
Sets the HTTP client timeout in seconds.
Parameter properties
| Type: | System.Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | cf |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-MaxRetry
Sets the maximum number of retries for a request with a maximum value of 10. This defaults to 3.
Parameter properties
| Type: | System.Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-RetriesTimeLimit
Sets the maximum time in seconds allowed for request retries.
Parameter properties
| Type: | System.Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-RetryDelay
Sets the waiting time in seconds before retrying a request with a maximum value of 180 seconds. This defaults to 3 seconds.
Parameter properties
| Type: | System.Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
| Type: | System.Management.Automation.SwitchParameter |
| Default value: | False |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | wi |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.