Get-PowerBIAccessToken
Gets the access token for your current Power BI authenticated session.
Sözdizimi
Default EnterprisePublishing
Get-PowerBIAccessToken
[-AsString]
[<CommonParameters>]
Description
Returns the Power BI access token gathered from logged in Power BI profile. Before you run this command, make sure you log in using Connect-PowerBIServiceAccount.
Örnekler
Example 1
PS C:\> $headers = Get-PowerBIAccessToken
PS C:\> Invoke-RestMethod -Headers $headers -Uri 'https://api.powerbi.com/v1.0/myorg/groups'
Gets the Power BI access token as a hashtable and passes it to Invoke-RestMethod, as part of the header, to authenticate.
Parametreler
-AsString
Indicates to return the access token as a string instead of a hashtable. The string contains the authentication type, such as "Bearer".
Parametre özellikleri
Tür: | SwitchParameter |
Default value: | None |
Joker karakterleri destekler: | False |
DontShow: | False |
Parametre kümeleri
(All)
Position: | Named |
Zorunlu: | False |
İşlem hattından gelen değer: | False |
İşlem hattından özellik adına göre değer: | False |
Kalan argümanlardan elde edilen değer: | 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.