Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6cb1f58

Browse files
Add example
1 parent 9b88b26 commit 6cb1f58

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎AZURE-Get-AzToken/Get-AzToken.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
This is using the Get-AzContext cmdlets from the module Az.Account and assume a session is already opened.
77
88
.EXAMPLE
9-
Get-AzToken
9+
$token=Get-AzToken
10+
$uri = "https://management.azure.com/tenants?api-version=2019年11月01日"
11+
invoke-restmethod -method get -uri $uri -Headers @{Authorization="Bearer $token";'Content-Type'='application/json'}
1012
13+
This leverate the token of the current session to query the Azure Management
14+
API and retrieves all the tenants information
1115
.LINK
1216
https://github.com/lazywinadmin/PowerShell
1317

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /