Skip to content

Commit 6031f0f

Browse files
Move Resources to main (#27044)
1 parent dcb0edd commit 6031f0f

File tree

246 files changed

+4176
-1091
lines changed

Some content is hidden

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

246 files changed

+4176
-1091
lines changed

src/Resources/Authorization.Autorest/Az.Authorization.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@{
2-
GUID = '7f96e662-b170-4f95-899f-bbd1828cd20b'
2+
GUID = '5e804a75-47b7-4aac-9e3b-4bbc49a1abca'
33
RootModule = './Az.Authorization.psm1'
44
ModuleVersion = '0.1.0'
55
CompatiblePSEditions = 'Core', 'Desktop'

src/Resources/Authorization.Autorest/help/Az.Authorization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Authorization
3-
Module Guid: 7f96e662-b170-4f95-899f-bbd1828cd20b
3+
Module Guid: 5e804a75-47b7-4aac-9e3b-4bbc49a1abca
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.authorization
55
Help Version: 1.0.0.0
66
Locale: en-US

src/Resources/Policy.Autorest/examples/Get-AzPolicyExemption.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ The second command gets the policy exemption named PolicyExemption07 for the sco
1616

1717
### Example 3: Get all policy exemptions associated with a policy assignment
1818
```powershell
19-
$Assignment = Get-AzPolicyAssignment -Name 'PolicyAssignment07'
20-
Get-AzPolicyExemption -PolicyAssignmentIdFilter $Assignment.ResourceId
19+
$ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11'
20+
$Assignment = Get-AzPolicyAssignment -Name 'PolicyAssignment07' -Scope $ResourceGroup.ResourceId
21+
Get-AzPolicyExemption -PolicyAssignmentIdFilter $Assignment.Id
2122
```
2223

2324
The first command gets a policy assignment named PolicyAssignment07.

src/Resources/Policy.Autorest/examples/Remove-AzPolicyAssignment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The **ResourceId** property of $ResourceGroup identifies the resource group.
1313
```powershell
1414
$ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11'
1515
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment07' -Scope $ResourceGroup.ResourceId
16-
Remove-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -Confirm:$false
16+
Remove-AzPolicyAssignment -Id $PolicyAssignment.Id -Confirm:$false
1717
```
1818

1919
The first command gets a resource group named ResourceGroup11, and then stores that object in the $ResourceGroup variable.
@@ -24,7 +24,7 @@ The final command removes the policy assignment that the **ResourceId** property
2424
### Example 3: [Backcompat] Remove policy assignment by ID
2525
```powershell
2626
$ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11'
27-
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment07' -Scope $ResourceGroup.ResourceId
27+
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment07' -Scope $ResourceGroup.ResourceId -BackwardCompatible
2828
Remove-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -Confirm:$false -BackwardCompatible
2929
True
3030
```

src/Resources/Policy.Autorest/examples/Remove-AzPolicyDefinition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ This command removes the specified policy definition.
88
### Example 2: Remove policy definition by resource ID
99
```powershell
1010
$PolicyDefinition = Get-AzPolicyDefinition -Name 'VMPolicyDefinition'
11-
Remove-AzPolicyDefinition -Id $PolicyDefinition.ResourceId -Force
11+
Remove-AzPolicyDefinition -Id $PolicyDefinition.Id -Force
1212
```
1313

1414
This command removes the given policy definition without prompting the user.
1515

1616
### Example 3: [Backcompat] Remove policy definition by resource ID
1717
```powershell
18-
$PolicyDefinition = Get-AzPolicyDefinition -Name 'VMPolicyDefinition'
18+
$PolicyDefinition = Get-AzPolicyDefinition -Name 'VMPolicyDefinition' -BackwardCompatible
1919
Remove-AzPolicyDefinition -Id $PolicyDefinition.ResourceId -Force -BackwardCompatible
2020
True
2121
```

src/Resources/Policy.Autorest/examples/Remove-AzPolicyExemption.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The **ResourceId** property of $ResourceGroup identifies the resource group.
1313
```powershell
1414
$ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11'
1515
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId
16-
Remove-AzPolicyExemption -Id $PolicyExemption.ResourceId -Confirm
16+
Remove-AzPolicyExemption -Id $PolicyExemption.Id -Confirm
1717
```
1818

1919
The first command gets a resource group named ResourceGroup11, and then stores that object in the $ResourceGroup variable.
@@ -24,7 +24,7 @@ The final command removes the policy exemption that the **ResourceId** property
2424
### Example 3: [Backcompat] Remove policy exemption by ID
2525
```powershell
2626
$ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11'
27-
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId
27+
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId -BackwardCompatible
2828
Remove-AzPolicyExemption -Id $PolicyExemption.ResourceId -Force -BackwardCompatible
2929
True
3030
```

src/Resources/Policy.Autorest/examples/Remove-AzPolicySetDefinition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Example 1: Remove policy set definition by resource ID
22
```powershell
33
$PolicySetDefinition = Get-AzPolicySetDefinition -ResourceId '/subscriptions/mySub/Microsoft.Authorization/policySetDefinitions/myPSSetDefinition'
4-
Remove-AzPolicySetDefinition -Id $PolicySetDefinition.ResourceId -Force
4+
Remove-AzPolicySetDefinition -Id $PolicySetDefinition.Id -Force
55
```
66

77
The first command gets a policy set definition by using the Get-AzPolicySetDefinition cmdlet.
@@ -10,7 +10,7 @@ The second command removes the policy set definition identified by the **Resourc
1010

1111
### Example 2: [Backcompat] Remove policy set definition by resource ID
1212
```powershell
13-
$PolicySetDefinition = Get-AzPolicySetDefinition -ResourceId '/subscriptions/mySub/Microsoft.Authorization/policySetDefinitions/myPSSetDefinition'
13+
$PolicySetDefinition = Get-AzPolicySetDefinition -ResourceId '/subscriptions/mySub/Microsoft.Authorization/policySetDefinitions/myPSSetDefinition' -BackwardCompatible
1414
Remove-AzPolicySetDefinition -Id $PolicySetDefinition.ResourceId -Force -BackwardCompatible
1515
True
1616
```

src/Resources/Policy.Autorest/examples/Update-AzPolicyAssignment.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
```powershell
33
$ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11'
44
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' -Scope $ResourceGroup.ResourceId
5-
Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -DisplayName 'Do not allow VM creation'
5+
Update-AzPolicyAssignment -Id $PolicyAssignment.Id -DisplayName 'Do not allow VM creation'
66
```
77

88
The first command gets a resource group named ResourceGroup11 by using the Get-AzResourceGroup cmdlet.
@@ -14,7 +14,7 @@ The final command updates the display name on the policy assignment on the resou
1414
### Example 2: Add a system assigned managed identity to the policy assignment
1515
```powershell
1616
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment'
17-
Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -IdentityType 'SystemAssigned' -Location 'westus'
17+
Update-AzPolicyAssignment -Id $PolicyAssignment.Id -IdentityType 'SystemAssigned' -Location 'westus'
1818
```
1919

2020
The first command gets the policy assignment named PolicyAssignment from the current subscription by using the Get-AzPolicyAssignment cmdlet.
@@ -25,7 +25,7 @@ The final command assigns a system assigned managed identity to the policy assig
2525
```powershell
2626
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment'
2727
$UserAssignedIdentity = Get-AzUserAssignedIdentity -ResourceGroupName 'ResourceGroup1' -Name 'UserAssignedIdentity1'
28-
Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -IdentityType 'UserAssigned' -Location 'westus' -IdentityId $UserAssignedIdentity.Id
28+
Update-AzPolicyAssignment -Id $PolicyAssignment.Id -IdentityType 'UserAssigned' -Location 'westus' -IdentityId $UserAssignedIdentity.Id
2929
```
3030

3131
The first command gets the policy assignment named PolicyAssignment from the current subscription by using the Get-AzPolicyAssignment cmdlet.
@@ -38,7 +38,7 @@ The final command assigns the user assigned managed identity identified by the *
3838
$Locations = Get-AzLocation | Where-Object {($_.displayname -like 'france*') -or ($_.displayname -like 'uk*')}
3939
$AllowedLocations = @{'listOfAllowedLocations'=($Locations.location)}
4040
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment'
41-
Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -PolicyParameterObject $AllowedLocations
41+
Update-AzPolicyAssignment -Id $PolicyAssignment.Id -PolicyParameterObject $AllowedLocations
4242
```
4343

4444
The first and second commands create an object containing all Azure regions whose names start with "france" or "uk".
@@ -72,7 +72,7 @@ The command updates the policy assignment named 'PolicyAssignment' using the pol
7272
```powershell
7373
$ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11'
7474
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' -Scope $ResourceGroup.ResourceId
75-
Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -EnforcementMode Default
75+
Update-AzPolicyAssignment -Id $PolicyAssignment.Id -EnforcementMode Default
7676
```
7777

7878
The first command gets a resource group named ResourceGroup11 by using the Get-AzResourceGroup cmdlet.
@@ -84,7 +84,7 @@ The final command updates the enforcementMode property on the policy assignment
8484
### Example 7: Update non-compliance messages
8585
```powershell
8686
$PolicyAssignment = Get-AzPolicyAssignment -Name 'VirtualMachinePolicy'
87-
Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -NonComplianceMessage @{Message="All resources must follow resource naming guidelines."}
87+
Update-AzPolicyAssignment -Id $PolicyAssignment.Id -NonComplianceMessage @{Message="All resources must follow resource naming guidelines."}
8888
```
8989

9090
The first command gets the policy assignment named VirtualMachinePolicy by using the Get-AzPolicyAssignment cmdlet and stores it in the $PolicyAssignment variable.
@@ -113,7 +113,7 @@ The final command updates the policy assignment named VirtualMachinePolicyAssign
113113
### Example 10: [Backcompat] Update an enforcementMode
114114
```powershell
115115
$ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11'
116-
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' -Scope $ResourceGroup.ResourceId
116+
$PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' -Scope $ResourceGroup.ResourceId -BackwardCompatible
117117
Set-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -EnforcementMode Default
118118
```
119119

src/Resources/Policy.Autorest/examples/Update-AzPolicyDefinition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
### Example 1: Update the description of a policy definition
22
```powershell
33
$PolicyDefinition = Get-AzPolicyDefinition -Name 'VMPolicyDefinition'
4-
Update-AzPolicyDefinition -Id $PolicyDefinition.ResourceId -Description 'Updated policy to not allow virtual machine creation'
4+
Update-AzPolicyDefinition -Id $PolicyDefinition.Id -Description 'Updated policy to not allow virtual machine creation'
55
```
66

77
The first command gets a policy definition named VMPolicyDefinition by using the Get-AzPolicyDefinition cmdlet.
88
The command stores that object in the $PolicyDefinition variable.
9-
The second command updates the description of the policy definition identified by the **ResourceId** property of $PolicyDefinition.
9+
The second command updates the description of the policy definition identified by the **Id** property of $PolicyDefinition.
1010

1111
### Example 2: Update the mode of a policy definition
1212
```powershell

src/Resources/Policy.Autorest/examples/Update-AzPolicyExemption.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### Example 1: Update the display name
22
```powershell
33
$ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11'
4-
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId
5-
Update-AzPolicyExemption -Id $PolicyExemption.ResourceId -DisplayName 'Exempt VM creation limit'
4+
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId
5+
Update-AzPolicyExemption -Id $PolicyExemption.Id -DisplayName 'Exempt VM creation limit'
66
```
77

88
The first command gets a resource group named ResourceGroup11 by using the Get-AzResourceGroup cmdlet.
@@ -15,7 +15,7 @@ The final command updates the display name on the policy exemption on the resour
1515
```powershell
1616
$NextMonth = (Get-Date).AddMonths(1)
1717
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07'
18-
Update-AzPolicyExemption -Id $PolicyExemption.ResourceId -ExpiresOn $NextMonth
18+
Update-AzPolicyExemption -Id $PolicyExemption.Id -ExpiresOn $NextMonth
1919
```
2020

2121
The first command gets the current date time by using the Get-Date cmdlet and add 1 month to the current date time
@@ -27,7 +27,7 @@ The final command updates the expiration date time for the policy exemption on t
2727
### Example 3: Clear the expiration date time
2828
```powershell
2929
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07'
30-
Update-AzPolicyExemption -Id $PolicyExemption.ResourceId -ClearExpiration
30+
Update-AzPolicyExemption -Id $PolicyExemption.Id -ClearExpiration
3131
```
3232

3333
The first command gets the policy exemption named PolicyExemption07 by using the Get-AzPolicyExemption cmdlet.
@@ -38,7 +38,7 @@ The updated exemption will never expire.
3838
### Example 4: Update the expiration category
3939
```powershell
4040
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07'
41-
Update-AzPolicyExemption -Id $PolicyExemption.ResourceId -ExemptionCategory Mitigated
41+
Update-AzPolicyExemption -Id $PolicyExemption.Id -ExemptionCategory Mitigated
4242
```
4343

4444
The first command gets the policy exemption named PolicyExemption07 by using the Get-AzPolicyExemption cmdlet.
@@ -63,8 +63,8 @@ The final command updates the policy exemption named VirtualMachineExemption wit
6363

6464
### Example 6: [Backcompat] Clear the expiration date time
6565
```powershell
66-
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07'
67-
Set-AzPolicyExemption -Id $PolicyExemption.ResourceId -ClearExpiration
66+
$PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' -BackwardCompatible
67+
Set-AzPolicyExemption -Id $PolicyExemption.ResourceId -ClearExpiration -BackwardCompatible
6868
```
6969

7070
The first command gets the policy exemption named PolicyExemption07 by using the Get-AzPolicyExemption cmdlet.

0 commit comments

Comments
 (0)