Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ https://learn.microsoft.com/powershell/module/az.resources/new-azpolicyassignmen
#>
function New-AzPolicyAssignment {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment])]
[CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$false, ConfirmImpact='None')]
[CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Low')]
param(
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ https://learn.microsoft.com/powershell/module/az.resources/new-azpolicydefinitio
#>
function New-AzPolicyDefinition {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinition])]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$false, ConfirmImpact='None')]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='Low')]
param(
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ https://learn.microsoft.com/powershell/module/az.resources/new-azpolicyexemption
#>
function New-AzPolicyExemption {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220701Preview.IPolicyExemption])]
[CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$false, ConfirmImpact='None')]
[CmdletBinding(DefaultParameterSetName='Default', SupportsShouldProcess=$true, ConfirmImpact='Low')]
param(
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ https://learn.microsoft.com/powershell/module/az.resources/new-azpolicysetdefini
#>
function New-AzPolicySetDefinition {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinition])]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$false, ConfirmImpact='None')]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='Low')]
param(
[Parameter(Mandatory, ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ https://learn.microsoft.com/powershell/module/az.resources/update-azpolicyassign
function Update-AzPolicyAssignment {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment])]
[Alias('Set-AzPolicyAssignment')]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$false, ConfirmImpact='Low')]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='Low')]
param(
[Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)]
[Parameter(ParameterSetName='NameParameterObject', Mandatory, ValueFromPipelineByPropertyName)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ https://learn.microsoft.com/powershell/module/az.resources/update-azpolicydefini
#>
function Update-AzPolicyDefinition {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinition])]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$false, ConfirmImpact='Low')]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='Low')]
[Alias('Set-AzPolicyDefinition')]
param(
[Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ https://learn.microsoft.com/powershell/module/az.resources/update-azpolicyexempt
function Update-AzPolicyExemption {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220701Preview.IPolicyExemption])]
[Alias('Set-AzPolicyExemption')]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$false, ConfirmImpact='Low')]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='Low')]
param(
[Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ https://learn.microsoft.com/powershell/module/az.resources/update-azpolicysetdef
#>
function Update-AzPolicySetDefinition {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinition])]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$false, ConfirmImpact='Low')]
[CmdletBinding(DefaultParameterSetName='Name', SupportsShouldProcess=$true, ConfirmImpact='Low')]
[Alias('Set-AzPolicySetDefinition')]
param(
[Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyAssignment
### Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment

## NOTES

Expand Down
68 changes: 59 additions & 9 deletions src/Resources/Policy.Autorest/docs/New-AzPolicyAssignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,32 @@ New-AzPolicyAssignment -Name <String> [-Scope <String>] [-BackwardCompatible] [-
[-DisplayName <String>] [-EnforcementMode <EnforcementMode>] [-IdentityId <String>]
[-IdentityType <ResourceIdentityType>] [-Location <String>] [-Metadata <String>]
[-NonComplianceMessage <PSObject[]>] [-NotScope <String[]>] [-PolicyDefinition <PSObject>]
[-PolicySetDefinition <PSObject>] [-DefaultProfile <PSObject>] [<CommonParameters>]
[-PolicySetDefinition <PSObject>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateExpanded
```
New-AzPolicyAssignment [-Description <String>] [-DisplayName <String>] [-EnforcementMode <EnforcementMode>]
[-IdentityType <ResourceIdentityType>] [-IdentityUserAssignedIdentity <Hashtable>] [-Location <String>]
[-NotScope <String[]>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
[-NotScope <String[]>] [-Override <IOverride[]>] [-ResourceSelector <IResourceSelector[]>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateExpanded1
```
New-AzPolicyAssignment [-Description <String>] [-DisplayName <String>] [-EnforcementMode <EnforcementMode>]
[-IdentityType <ResourceIdentityType>] [-IdentityUserAssignedIdentity <Hashtable>] [-Location <String>]
[-NotScope <String[]>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
[-NotScope <String[]>] [-Override <IOverride[]>] [-ResourceSelector <IResourceSelector[]>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateViaIdentityExpanded1
```
New-AzPolicyAssignment -InputObject <IPolicyIdentity> [-Description <String>] [-DisplayName <String>]
[-EnforcementMode <EnforcementMode>] [-IdentityType <ResourceIdentityType>]
[-IdentityUserAssignedIdentity <Hashtable>] [-Location <String>] [-NotScope <String[]>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
[-Override <IOverride[]>] [-ResourceSelector <IResourceSelector[]>] [-DefaultProfile <PSObject>] [-Confirm]
[-WhatIf] [<CommonParameters>]
```

### ParameterObject
Expand All @@ -51,7 +54,7 @@ New-AzPolicyAssignment -Name <String> -PolicyDefinition <PSObject> -PolicyParame
[-Scope <String>] [-BackwardCompatible] [-Description <String>] [-DisplayName <String>]
[-EnforcementMode <EnforcementMode>] [-IdentityId <String>] [-IdentityType <ResourceIdentityType>]
[-Location <String>] [-Metadata <String>] [-NonComplianceMessage <PSObject[]>] [-NotScope <String[]>]
[-PolicySetDefinition <PSObject>] [-DefaultProfile <PSObject>] [<CommonParameters>]
[-PolicySetDefinition <PSObject>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### ParameterString
Expand All @@ -60,7 +63,7 @@ New-AzPolicyAssignment -Name <String> -PolicyDefinition <PSObject> -PolicyParame
[-BackwardCompatible] [-Description <String>] [-DisplayName <String>] [-EnforcementMode <EnforcementMode>]
[-IdentityId <String>] [-IdentityType <ResourceIdentityType>] [-Location <String>] [-Metadata <String>]
[-NonComplianceMessage <PSObject[]>] [-NotScope <String[]>] [-PolicySetDefinition <PSObject>]
[-DefaultProfile <PSObject>] [<CommonParameters>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### SetParameterObject
Expand All @@ -69,7 +72,7 @@ New-AzPolicyAssignment -Name <String> -PolicyParameterObject <Hashtable> -Policy
[-Scope <String>] [-BackwardCompatible] [-Description <String>] [-DisplayName <String>]
[-EnforcementMode <EnforcementMode>] [-IdentityId <String>] [-IdentityType <ResourceIdentityType>]
[-Location <String>] [-Metadata <String>] [-NonComplianceMessage <PSObject[]>] [-NotScope <String[]>]
[-PolicyDefinition <PSObject>] [-DefaultProfile <PSObject>] [<CommonParameters>]
[-PolicyDefinition <PSObject>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### SetParameterString
Expand All @@ -78,7 +81,7 @@ New-AzPolicyAssignment -Name <String> -PolicyParameter <String> -PolicySetDefini
[-Scope <String>] [-BackwardCompatible] [-Description <String>] [-DisplayName <String>]
[-EnforcementMode <EnforcementMode>] [-IdentityId <String>] [-IdentityType <ResourceIdentityType>]
[-Location <String>] [-Metadata <String>] [-NonComplianceMessage <PSObject[]>] [-NotScope <String[]>]
[-PolicyDefinition <PSObject>] [-DefaultProfile <PSObject>] [<CommonParameters>]
[-PolicyDefinition <PSObject>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -460,6 +463,22 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Override
The policy property value override.
To construct, see NOTES section for OVERRIDE properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.ApiV1.IOverride[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -PolicyDefinition
The ID of the policy definition or policy set definition being assigned.
To construct, see NOTES section for POLICYDEFINITION properties and create a hash table.
Expand Down Expand Up @@ -524,6 +543,22 @@ Accept pipeline input: True (ByValue, ByPropertyName)
Accept wildcard characters: False
```

### -ResourceSelector
The resource selector list to filter policies by resource properties.
To construct, see NOTES section for RESOURCESELECTOR properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.ApiV1.IResourceSelector[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Scope
The scope of the policy assignment.
Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
Expand Down Expand Up @@ -590,7 +625,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyAssignment
### Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment

## NOTES

Expand Down Expand Up @@ -621,6 +656,14 @@ To create the parameters described below, construct a hash table containing the
- `Message <String>`: A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.
- `[PolicyDefinitionReferenceId <String>]`: The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.

`OVERRIDE <IOverride[]>`: The policy property value override.
- `[Kind <OverrideKind?>]`: The override kind.
- `[Selector <ISelector[]>]`: The list of the selector expressions.
- `[In <String[]>]`: The list of values to filter in.
- `[Kind <SelectorKind?>]`: The selector kind.
- `[NotIn <String[]>]`: The list of values to filter out.
- `[Value <String>]`: The value to override the policy property.

`POLICYDEFINITION <PSObject>`: The ID of the policy definition or policy set definition being assigned.
- `[Description <String>]`: The policy definition description.
- `[DisplayName <String>]`: The display name of the policy definition.
Expand Down Expand Up @@ -666,5 +709,12 @@ To create the parameters described below, construct a hash table containing the
- `[SystemDataLastModifiedBy <String>]`: The identity that last modified the resource.
- `[SystemDataLastModifiedByType <CreatedByType?>]`: The type of identity that last modified the resource.

`RESOURCESELECTOR <IResourceSelector[]>`: The resource selector list to filter policies by resource properties.
- `[Name <String>]`: The name of the resource selector.
- `[Selector <ISelector[]>]`: The list of the selector expressions.
- `[In <String[]>]`: The list of values to filter in.
- `[Kind <SelectorKind?>]`: The selector kind.
- `[NotIn <String[]>]`: The list of values to filter out.

## RELATED LINKS

37 changes: 34 additions & 3 deletions src/Resources/Policy.Autorest/docs/New-AzPolicyDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ Creates or updates a policy definition.
```
New-AzPolicyDefinition -Name <String> -Policy <String> [-BackwardCompatible] [-Description <String>]
[-DisplayName <String>] [-Metadata <String>] [-Mode <String>] [-Parameter <String>]
[-DefaultProfile <PSObject>] [<CommonParameters>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### ManagementGroupName
```
New-AzPolicyDefinition -ManagementGroupName <String> -Name <String> -Policy <String> [-BackwardCompatible]
[-Description <String>] [-DisplayName <String>] [-Metadata <String>] [-Mode <String>] [-Parameter <String>]
[-DefaultProfile <PSObject>] [<CommonParameters>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### SubscriptionId
```
New-AzPolicyDefinition -Name <String> -SubscriptionId <String> -Policy <String> [-BackwardCompatible]
[-Description <String>] [-DisplayName <String>] [-Metadata <String>] [-Mode <String>] [-Parameter <String>]
[-DefaultProfile <PSObject>] [<CommonParameters>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -279,6 +279,37 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

Expand Down
44 changes: 43 additions & 1 deletion src/Resources/Policy.Autorest/docs/New-AzPolicyExemption.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Creates or updates a policy exemption.
New-AzPolicyExemption [-Name] <String> [-ExemptionCategory] <ExemptionCategory> [-PolicyAssignment] <PSObject>
[[-Scope] <String>] [[-AssignmentScopeValidation] <AssignmentScopeValidation>] [[-DisplayName] <String>]
[[-Description] <String>] [[-PolicyDefinitionReferenceId] <String[]>] [[-ExpiresOn] <DateTime?>]
[[-Metadata] <String>] [[-DefaultProfile] <PSObject>] [-BackwardCompatible] [<CommonParameters>]
[[-Metadata] <String>] [[-DefaultProfile] <PSObject>] [-BackwardCompatible] [-Confirm] [-WhatIf]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -232,6 +233,37 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

Expand Down Expand Up @@ -276,9 +308,19 @@ To create the parameters described below, construct a hash table containing the
- `Message <String>`: A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.
- `[PolicyDefinitionReferenceId <String>]`: The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.
- `[NotScope <String[]>]`: The policy's excluded scopes.
- `[Override <IOverride[]>]`: The policy property value override.
- `[Kind <OverrideKind?>]`: The override kind.
- `[Selector <ISelector[]>]`: The list of the selector expressions.
- `[In <String[]>]`: The list of values to filter in.
- `[Kind <SelectorKind?>]`: The selector kind.
- `[NotIn <String[]>]`: The list of values to filter out.
- `[Value <String>]`: The value to override the policy property.
- `[Parameter <IParameterValues>]`: The parameter values for the assigned policy rule. The keys are the parameter names.
- `[(Any) <Object>]`: This indicates any property can be added to this object.
- `[PolicyDefinitionId <String>]`: The ID of the policy definition or policy set definition being assigned.
- `[ResourceSelector <IResourceSelector[]>]`: The resource selector list to filter policies by resource properties.
- `[Name <String>]`: The name of the resource selector.
- `[Selector <ISelector[]>]`: The list of the selector expressions.
- `[SystemDataCreatedAt <DateTime?>]`: The timestamp of resource creation (UTC).
- `[SystemDataCreatedBy <String>]`: The identity that created the resource.
- `[SystemDataCreatedByType <CreatedByType?>]`: The type of identity that created the resource.
Expand Down
Loading