Skip to content

Commit a8e2cee

Browse files
authored
Merge pull request Azure#17324 from v-yuzhichen/Resources
Split Az.Resources Examples
2 parents db25f40 + 82d9a17 commit a8e2cee

File tree

138 files changed

+774
-726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+774
-726
lines changed

src/Resources/Resources/help/Add-AzADAppPermission.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ User needs to grant consent via Azure Portal if the permission requires admin co
4141

4242
### Example 1: Add API Permission
4343
```powershell
44-
PS C:\> Add-AzADAppPermission -ObjectId 9cc74d5e-1162-4b90-8696-65f3d6a3f7d0 -ApiId 00000003-0000-0000-c000-000000000000 -PermissionId 5f8c59db-677d-491f-a6b8-5f174b11ec1d
44+
Add-AzADAppPermission -ObjectId 9cc74d5e-1162-4b90-8696-65f3d6a3f7d0 -ApiId 00000003-0000-0000-c000-000000000000 -PermissionId 5f8c59db-677d-491f-a6b8-5f174b11ec1d
4545
```
4646

4747
Add delegated permission "Group.Read.All" of Microsoft Graph API to AD Application (9cc74d5e-1162-4b90-8696-65f3d6a3f7d0)
4848

4949
### Example 2: Add API Permission
5050
```powershell
51-
PS C:\> Add-AzADAppPermission -ObjectId 9cc74d5e-1162-4b90-8696-65f3d6a3f7d0 -ApiId 00000003-0000-0000-c000-000000000000 -PermissionId 1138cb37-bd11-4084-a2b7-9f71582aeddb -Type Role
51+
Add-AzADAppPermission -ObjectId 9cc74d5e-1162-4b90-8696-65f3d6a3f7d0 -ApiId 00000003-0000-0000-c000-000000000000 -PermissionId 1138cb37-bd11-4084-a2b7-9f71582aeddb -Type Role
5252
```
5353

5454
Add application permission "Device.ReadWrite.All" of Microsoft Graph API to AD Application (9cc74d5e-1162-4b90-8696-65f3d6a3f7d0)

src/Resources/Resources/help/Add-AzADGroupMember.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ Adds member to group.
5555

5656
### Example 1: Add members to group
5757
```powershell
58-
PS C:\> $groupid=(Get-AzADGroup -DisplayName $gname).Id
59-
PS C:\> $members=@()
60-
PS C:\> $members+=(Get-AzADUser -DisplayName $uname).Id
61-
PS C:\> $members+=(Get-AzADServicePrincipal -ApplicationId $appid).Id
62-
PS C:\> Add-AzADGroupMember -TargetGroupObjectId $groupid MemberObjectId $members
58+
$groupid=(Get-AzADGroup -DisplayName $gname).Id
59+
$members=@()
60+
$members+=(Get-AzADUser -DisplayName $uname).Id
61+
$members+=(Get-AzADServicePrincipal -ApplicationId $appid).Id
62+
Add-AzADGroupMember -TargetGroupObjectId $groupid MemberObjectId $members
6363
```
6464

6565
Add members to group

src/Resources/Resources/help/Export-AzResourceGroup.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ The template will still be generated for the parts that were successful.
3030
## EXAMPLES
3131

3232
### Example 1: Export a resource group
33-
```
34-
PS C:\>Export-AzResourceGroup -ResourceGroupName "TestGroup"
33+
```powershell
34+
Export-AzResourceGroup -ResourceGroupName "TestGroup"
3535
```
3636

3737
This command captures the resource group named TestGroup as a template, and saves it to a JSON file in the current directory.
3838

3939
### Example 2: Export a single resource from a resource group
40-
```
41-
PS C:\>Export-AzResourceGroup -ResourceGroupName "TestGroup" -Resource "/subscriptions/5f43547b-1d2d-4a3e-ace4-88d4b600d568/resourceGroups/TestGroup/providers/Microsoft.Compute/virtualMachines/TestVirtualMachine"
40+
```powershell
41+
Export-AzResourceGroup -ResourceGroupName "TestGroup" -Resource "/subscriptions/5f43547b-1d2d-4a3e-ace4-88d4b600d568/resourceGroups/TestGroup/providers/Microsoft.Compute/virtualMachines/TestVirtualMachine"
4242
```
4343

4444
This command captures the Virtual Machine resource named "TestVirtualMachine" from the "TestGroup" resource group as a template, and saves it to a JSON file in the current directory.
4545

4646
### Example 3: Export a selection of resources from a resource group
47-
```
48-
PS C:\>Export-AzResourceGroup -ResourceGroupName "TestGroup" -SkipAllParameterization -Resource @(
47+
```powershell
48+
Export-AzResourceGroup -ResourceGroupName "TestGroup" -SkipAllParameterization -Resource @(
4949
"/subscriptions/5f43547b-1d2d-4a3e-ace4-88d4b600d568/resourceGroups/TestGroup/providers/Microsoft.Compute/virtualMachines/TestVm",
5050
"/subscriptions/5f43547b-1d2d-4a3e-ace4-88d4b600d568/resourceGroups/TestGroup/providers/Microsoft.Network/networkInterfaces/TestNic"
5151
)

src/Resources/Resources/help/Export-AzTemplateSpec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ Exports a specific Template Spec version to the local filesystem.
3131

3232
### Example 1: Export by name
3333
```powershell
34-
PS C:\> Export-AzTemplateSpec -ResourceGroupName 'myRG' -Name 'MyTemplateSpec' -Version 'v1.0' -OutputFolder 'v1'
34+
Export-AzTemplateSpec -ResourceGroupName 'myRG' -Name 'MyTemplateSpec' -Version 'v1.0' -OutputFolder 'v1'
3535
```
3636

3737
Exports version 'v1.0' of the Template Spec named 'MyTemplateSpec' within the resource group 'myRG' to the local output folder "v1".
3838

3939
### Example 2: Export by resource id
4040
```powershell
41-
PS C:\> Export-AzTemplateSpec -ResourceId '/subscriptions/{subId}/resourceGroups/myRG/providers/Microsoft.Resources/templateSpecs/MyTemplateSpec' -Version 'v1.0' -OutputFolder 'v1'
41+
Export-AzTemplateSpec -ResourceId '/subscriptions/{subId}/resourceGroups/myRG/providers/Microsoft.Resources/templateSpecs/MyTemplateSpec' -Version 'v1.0' -OutputFolder 'v1'
4242
```
4343

4444
Exports version 'v1.0' of the Template Spec named 'MyTemplateSpec' within the resource group 'myRG' of subscription \{subId\} to the local output folder "v1".

src/Resources/Resources/help/Get-AzADAppCredential.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Lists key credentials and password credentials for an application.
4242

4343
### Example 1: List credentials from application by display name
4444
```powershell
45-
PS C:\> Get-AzADAppCredential -DisplayName $name
45+
Get-AzADAppCredential -DisplayName $name
4646
```
4747

4848
List credentials from application by display name

src/Resources/Resources/help/Get-AzADAppPermission.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ Lists API permissions the application has requested.
2929

3030
### Example 1: Get API permission
3131
```powershell
32-
PS C:\> Get-AzADAppPermission -ObjectId 18797549-86a9-4906-b2a9-54f08cd3c427
33-
32+
Get-AzADAppPermission -ObjectId 18797549-86a9-4906-b2a9-54f08cd3c427
33+
```
34+
```output
3435
ApiId Id Type
3536
----- -- ----
3637
00000003-0000-0000-c000-000000000000 df021288-bdef-4463-88db-98f22de89214 Scope

src/Resources/Resources/help/Get-AzADApplication.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,28 @@ Lists entities from applications or get entity from applications by key
5656

5757
### Example 1: Get application by display name
5858
```powershell
59-
PS C:\> Get-AzADApplication -DisplayName $appname
59+
Get-AzADApplication -DisplayName $appname
6060
```
6161

6262
Get application by display name
6363

6464
### Example 2: List applications
6565
```powershell
66-
PS C:\> Get-AzADApplication -First 10
66+
Get-AzADApplication -First 10
6767
```
6868

6969
List first 10 applications
7070

7171
### Example 3: Search for application display name starts with
7272
```powershell
73-
PS C:\> Get-AzADApplication -DisplayNameStartsWith $prefix
73+
Get-AzADApplication -DisplayNameStartsWith $prefix
7474
```
7575

7676
Search for application display name starts with
7777

7878
### Example 4: Get application by object Id
7979
```powershell
80-
PS C:\> Get-AzADapplication -ObjectId $id -Select Tags -AppendSelected
80+
Get-AzADapplication -ObjectId $id -Select Tags -AppendSelected
8181
```
8282

8383
Get application by object Id and append property 'Tags' after default properties: 'DisplayName', 'Id', 'DeletedDateTime', 'IdentifierUris', 'Web', 'AppId', 'SignInAudience'

src/Resources/Resources/help/Get-AzADGroup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ Lists entities from groups or get entity from groups by key
4545

4646
### Example 1: Get group by display name
4747
```powershell
48-
PS C:\> Get-AzADGroup -DisplayName $gname
48+
Get-AzADGroup -DisplayName $gname
4949
```
5050

5151
Get group by display name
5252

5353
### Example 2: List groups
5454
```powershell
55-
PS C:\> Get-AzADGroup -First 10
55+
Get-AzADGroup -First 10
5656
```
5757

5858
List first 10 groups
5959

6060
### Example 3: Get group by object id
6161
```powershell
62-
PS C:\> Get-AzADGroup -ObjectId $id -Select groupTypes -AppendSelected
62+
Get-AzADGroup -ObjectId $id -Select groupTypes -AppendSelected
6363
```
6464

6565
Get group by object id and append property 'groupTypes' after default properties: 'DisplayName', 'Id', 'DeletedDateTime', 'SecurityEnabled', 'MailEnabled', 'MailNickname', 'Description'

src/Resources/Resources/help/Get-AzADGroupMember.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ Lists members from group.
4040

4141
### Example 1: List members by group display name
4242
```powershell
43-
PS C:\> Get-AzADGroupMember -GroupDisplayName $name
43+
Get-AzADGroupMember -GroupDisplayName $name
4444
```
4545

4646
List members by group display name
4747

4848
### Example 2: List members by pipeline input
4949
```powershell
50-
PS C:\> Get-AzADGroup -DisplayName $name | Get-AzADGroupMember
50+
Get-AzADGroup -DisplayName $name | Get-AzADGroupMember
5151
```
5252

5353
List members by pipeline input

src/Resources/Resources/help/Get-AzADServicePrincipal.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,35 +62,35 @@ Lists entities from service principals or get entity from service principals by
6262

6363
### Example 1: Get service principal by display name
6464
```powershell
65-
PS C:\> Get-AzADServicePrincipal -DisplayName $name
65+
Get-AzADServicePrincipal -DisplayName $name
6666
```
6767

6868
Get service principal by display name
6969

7070
### Example 2: Search for service principal display name starts with
7171
```powershell
72-
PS C:\> Get-AzADServicePrincipal -DisplayNameStartsWith $prefix
72+
Get-AzADServicePrincipal -DisplayNameStartsWith $prefix
7373
```
7474

7575
Search for service principal display name starts with
7676

7777
### Example 3: List service principals
7878
```powershell
79-
PS C:\> Get-AzADServicePrincipal -First 10 -Select Tags -AppendSelected
79+
Get-AzADServicePrincipal -First 10 -Select Tags -AppendSelected
8080
```
8181

8282
List first 10 service principals and append property 'Tags' after default properties: 'DisplayName', 'Id', 'DeletedDateTime', 'ServicePrincipalNames', 'AppId'
8383

8484
### Example 4: Get service principal by application Id
8585
```powershell
86-
PS C:\> Get-AzADServicePrincipal -ApplicationId $appId
86+
Get-AzADServicePrincipal -ApplicationId $appId
8787
```
8888

8989
Get service principal by application Id
9090

9191
### Example 5: Get service principal by pipeline input
9292
```powershell
93-
PS C:\> Get-AzADApplication -DisplayName $name | Get-AzADServicePrincipal
93+
Get-AzADApplication -DisplayName $name | Get-AzADServicePrincipal
9494
```
9595

9696
Get service principal by pipeline input

0 commit comments

Comments
 (0)