-
Notifications
You must be signed in to change notification settings - Fork 0
Get FscmOdataToken
Get an OData access token for a Finance and Operations environment.
Get-FscmOdataToken -EnvironmentId <String> [-ProgressAction <ActionPreference>] [<CommonParameters>]
Get-FscmOdataToken -EnvironmentId <String> [-AsObject] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Get-FscmOdataToken -EnvironmentId <String> [-AsBearerToken] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Acquires an Azure access token scoped to the Finance and Operations (FnO) OData resource of the specified environment, using the cached credentials in the local Azure PowerShell context.
The token is returned in plain text. Handle the output accordingly.
Get-FscmOdataToken -EnvironmentId "ContosoEnv"
This command acquires an OData access token for the environment "ContosoEnv" and returns the raw token string.
Get-FscmOdataToken -EnvironmentId "ContosoEnv" -AsBearerToken
This command acquires an OData access token for the environment "ContosoEnv" and returns it as a bearer token string, ready to use directly in an Authorization header.
$token = Get-FscmOdataToken -EnvironmentId "ContosoEnv" -AsObject
PS C:\> Invoke-RestMethod -Uri $uri -Headers @{ Authorization = $token.BearerToken }
This command acquires an OData access token for the environment "ContosoEnv" and returns a typed object with both Token and BearerToken properties.
The ID of the environment to acquire the token for.
Can be either the environment name, the environment GUID (PPAC) or the LCS environment ID.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOutput the token as a "Bearer" prefix string, ready to use in an Authorization header.
Type: SwitchParameter
Parameter Sets: BearerToken
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseOutput a typed PSCustomObject with Token and BearerToken properties.
Type: SwitchParameter
Parameter Sets: Object
Aliases:
Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Author: Mötz Jensen (@Splaxi)