Policy.Autorest/exports/ProxyCmdletDefinitions.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- <# .Synopsis This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group. .Description This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group. .Example $Subscription = Get-AzSubscription -SubscriptionName 'Subscription01' $Policy = Get-AzPolicyDefinition -Name 'VirtualMachinePolicy' New-AzPolicyAssignment -Name 'VirtualMachinePolicyAssignment' -PolicyDefinition $Policy -Scope "/subscriptions/$($Subscription.Id)" .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $Policy = Get-AzPolicyDefinition -Name 'VirtualMachinePolicy' New-AzPolicyAssignment -Name 'VirtualMachinePolicyAssignment' -PolicyDefinition $Policy -Scope $ResourceGroup.ResourceId .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $Policy = Get-AzPolicyDefinition -BuiltIn | Where-Object {$_.DisplayName -eq 'Allowed locations'} $Locations = Get-AzLocation | Where-Object displayname -like '*east*' $AllowedLocations = @{'listOfAllowedLocations'=($Locations.location)} New-AzPolicyAssignment -Name 'RestrictLocationPolicyAssignment' -PolicyDefinition $Policy -Scope $ResourceGroup.ResourceId -PolicyParameterObject $AllowedLocations .Example { "listOfAllowedLocations": { "value": [ "westus", "westeurope", "japanwest" ] } } $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $Policy = Get-AzPolicyDefinition -BuiltIn | Where-Object {$_.DisplayName -eq 'Allowed locations'} New-AzPolicyAssignment -Name 'RestrictLocationPolicyAssignment' -PolicyDefinition $Policy -Scope $ResourceGroup.ResourceId -PolicyParameter .\AllowedLocations.json .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $Policy = Get-AzPolicyDefinition -Name 'VirtualMachinePolicy' New-AzPolicyAssignment -Name 'VirtualMachinePolicyAssignment' -PolicyDefinition $Policy -Scope $ResourceGroup.ResourceId -Location 'eastus' -IdentityType 'SystemAssigned' .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $Policy = Get-AzPolicyDefinition -Name 'VirtualMachinePolicy' $UserAssignedIdentity = Get-AzUserAssignedIdentity -ResourceGroupName 'ResourceGroup1' -Name 'UserAssignedIdentity1' New-AzPolicyAssignment -Name 'VirtualMachinePolicyAssignment' -PolicyDefinition $Policy -Scope $ResourceGroup.ResourceId -Location 'eastus' -IdentityType 'UserAssigned' -IdentityId $UserAssignedIdentity.Id .Example $Subscription = Get-AzSubscription -SubscriptionName 'Subscription01' $Policy = Get-AzPolicyDefinition -Name 'VirtualMachinePolicy' New-AzPolicyAssignment -Name 'VirtualMachinePolicyAssignment' -PolicyDefinition $Policy -Scope "/subscriptions/$($Subscription.Id)" -EnforcementMode DoNotEnforce .Example $PolicySet = Get-AzPolicySetDefinition -Name 'VirtualMachinePolicySet' $NonComplianceMessages = @(@{Message="Only DsV2 SKUs are allowed."; PolicyDefinitionReferenceId="DefRef1"}, @{Message="Virtual machines must follow cost management best practices."}) New-AzPolicyAssignment -Name 'VirtualMachinePolicyAssignment' -PolicySetDefinition $PolicySet -NonComplianceMessage $NonComplianceMessages .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $Policy = Get-AzPolicyDefinition -BuiltIn | Where-Object {$_.Properties.DisplayName -eq 'Allowed locations'} $Locations = Get-AzLocation | Where-Object displayname -like '*east*' $AllowedLocations = @{'listOfAllowedLocations'=($Locations.location)} New-AzPolicyAssignment -Name 'RestrictLocationPolicyAssignment' -PolicyDefinition $Policy -Scope $ResourceGroup.ResourceId -PolicyParameterObject $AllowedLocations .Example { "listOfAllowedLocations": { "value": [ "westus", "westeurope", "japanwest" ] } } $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $Policy = Get-AzPolicyDefinition -BuiltIn | Where-Object {$_.Properties.DisplayName -eq 'Allowed locations'} New-AzPolicyAssignment -Name 'RestrictLocationPolicyAssignment' -PolicyDefinition $Policy -Scope $ResourceGroup.ResourceId -PolicyParameter .\AllowedLocations.json .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.EnforcementMode .Inputs System.Management.Automation.PSObject .Inputs System.Management.Automation.PSObject[] .Inputs System.String .Inputs System.String[] .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <IPolicyIdentity>: Identity Parameter [Id <String>]: Resource identity path [ManagementGroupId <String>]: The ID of the management group. [ParentResourcePath <String>]: The parent resource path. Use empty string if there is none. [PolicyAssignmentId <String>]: The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. [PolicyAssignmentName <String>]: The name of the policy assignment to delete. [PolicyDefinitionName <String>]: The name of the policy definition to create. [PolicyExemptionName <String>]: The name of the policy exemption to delete. [PolicySetDefinitionName <String>]: The name of the policy set definition to create. [ResourceGroupName <String>]: The name of the resource group that contains policy assignments. [ResourceName <String>]: The name of the resource. [ResourceProviderNamespace <String>]: The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) [ResourceType <String>]: The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). [Scope <String>]: 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}' [SubscriptionId <String>]: The ID of the target subscription. NONCOMPLIANCEMESSAGETABLE <INonComplianceMessage[]>: The messages that describe why a resource is non-compliant with the policy. 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. [Metadata <IPolicyDefinitionPropertiesMetadata>]: The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. [(Any) <Object>]: This indicates any property can be added to this object. [Mode <String>]: The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. [Parameter <IParameterDefinitions>]: The parameter definitions for parameters used in the policy rule. The keys are the parameter names. [(Any) <Object>]: This indicates any property can be added to this object. [PolicyRule <IPolicyDefinitionPropertiesPolicyRule>]: The policy rule. [(Any) <Object>]: This indicates any property can be added to this object. [PolicyType <PolicyType?>]: The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. [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. [SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC) [SystemDataLastModifiedBy <String>]: The identity that last modified the resource. [SystemDataLastModifiedByType <CreatedByType?>]: The type of identity that last modified the resource. POLICYSETDEFINITION <PSObject>: The ID of the policy definition or policy set definition being assigned. [Description <String>]: The policy set definition description. [DisplayName <String>]: The display name of the policy set definition. [Metadata <IPolicySetDefinitionPropertiesMetadata>]: The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. [(Any) <Object>]: This indicates any property can be added to this object. [Parameter <IParameterDefinitions>]: The policy set definition parameters that can be used in policy definition references. [(Any) <Object>]: This indicates any property can be added to this object. [PolicyDefinition <IPolicyDefinitionReference[]>]: An array of policy definition references. PolicyDefinitionId <String>: The ID of the policy definition or policy set definition. [GroupName <String[]>]: The name of the groups that this policy definition reference belongs to. [Id <String>]: A unique id (within the policy set definition) for this policy definition reference. [Parameter <IParameterValues>]: The parameter values for the referenced policy rule. The keys are the parameter names. [(Any) <Object>]: This indicates any property can be added to this object. [PolicyDefinitionGroup <IPolicyDefinitionGroup[]>]: The metadata describing groups of policy definition references within the policy set definition. Name <String>: The name of the group. [AdditionalMetadataId <String>]: A resource ID of a resource that contains additional metadata about the group. [Category <String>]: The group's category. [Description <String>]: The group's description. [DisplayName <String>]: The group's display name. [PolicyType <PolicyType?>]: The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. [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. [SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC) [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. .Link https://learn.microsoft.com/powershell/module/az.resources/new-azpolicyassignment #> function New-AzPolicyAssignment { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='Default', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='CreateViaIdentityExpanded1', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='Default', DontShow)] [Parameter(ParameterSetName='ParameterString', DontShow)] [Parameter(ParameterSetName='ParameterObject', DontShow)] [Parameter(ParameterSetName='SetParameterString', DontShow)] [Parameter(ParameterSetName='SetParameterObject', DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Default', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterString', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterObject', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterString', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterObject', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyAssignmentName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy assignment. ${Name}, [Parameter(ParameterSetName='Default', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterString', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterObject', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterString', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterObject', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # 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}' ${Scope}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # This message will be part of response in case of policy violation. ${Description}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The display name of the policy assignment. ${DisplayName}, [Parameter()] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.EnforcementMode])] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.EnforcementMode] # The policy assignment enforcement mode. # Possible values are Default and DoNotEnforce. ${EnforcementMode}, [Parameter()] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.ResourceIdentityType])] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.ResourceIdentityType] # The identity type. # This is the only required field when adding a system or user assigned identity to a resource. ${IdentityType}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateExpanded1')] [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IIdentityUserAssignedIdentities]))] [System.Collections.Hashtable] # The user identity associated with the policy. # The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. ${IdentityUserAssignedIdentity}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The location of the policy assignment. # Only required when utilizing managed identity. ${Location}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String[]] # The policy's excluded scopes. ${NotScope}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateExpanded1')] [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.ApiV1.IOverride[]] # The policy property value override. # To construct, see NOTES section for OVERRIDE properties and create a hash table. ${Override}, [Parameter(ParameterSetName='CreateExpanded')] [Parameter(ParameterSetName='CreateExpanded1')] [Parameter(ParameterSetName='CreateViaIdentityExpanded1')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.ApiV1.IResourceSelector[]] # The resource selector list to filter policies by resource properties. # To construct, see NOTES section for RESOURCESELECTOR properties and create a hash table. ${ResourceSelector}, [Parameter(ParameterSetName='Default', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterString', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterObject', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterString', ValueFromPipeline, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterObject', ValueFromPipeline, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinition]))] [System.Management.Automation.PSObject] # 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. ${PolicyDefinition}, [Parameter(ParameterSetName='Default', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterString', ValueFromPipeline, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterObject', ValueFromPipeline, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterString', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterObject', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinition]))] [System.Management.Automation.PSObject] # The ID of the policy definition or policy set definition being assigned. # To construct, see NOTES section for POLICYSETDEFINITION properties and create a hash table. ${PolicySetDefinition}, [Parameter(ParameterSetName='Default', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterString', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterObject', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterString', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterObject', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignmentPropertiesMetadata]))] [System.String] # The policy assignment metadata. # Metadata is an open ended object and is typically a collection of key value pairs. ${Metadata}, [Parameter(ParameterSetName='Default')] [Parameter(ParameterSetName='ParameterString')] [Parameter(ParameterSetName='ParameterObject')] [Parameter(ParameterSetName='SetParameterString')] [Parameter(ParameterSetName='SetParameterObject')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The user identity associated with the policy. # The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. ${IdentityId}, [Parameter(ParameterSetName='Default', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterString', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ParameterObject', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterString', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterObject', ValueFromPipelineByPropertyName)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.INonComplianceMessage[]]))] [System.Management.Automation.PSObject[]] # The messages that describe why a resource is non-compliant with the policy. ${NonComplianceMessage}, [Parameter(ParameterSetName='Default')] [Parameter(ParameterSetName='ParameterString')] [Parameter(ParameterSetName='ParameterObject')] [Parameter(ParameterSetName='SetParameterString')] [Parameter(ParameterSetName='SetParameterObject')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter(ParameterSetName='ParameterString', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SetParameterString', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The parameter values for the assigned policy rule. # The keys are the parameter names. ${PolicyParameter}, [Parameter(ParameterSetName='ParameterObject', Mandatory)] [Parameter(ParameterSetName='SetParameterObject', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Collections.Hashtable] # The parameter values for the assigned policy rule. # The keys are the parameter names. ${PolicyParameterObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ CreateExpanded = 'Az.Policy.private\New-AzPolicyAssignment_CreateExpanded'; CreateExpanded1 = 'Az.Policy.private\New-AzPolicyAssignment_CreateExpanded1'; CreateViaIdentityExpanded1 = 'Az.Policy.private\New-AzPolicyAssignment_CreateViaIdentityExpanded1'; Default = 'Az.Policy.custom\New-AzPolicyAssignment'; ParameterString = 'Az.Policy.custom\New-AzPolicyAssignment'; ParameterObject = 'Az.Policy.custom\New-AzPolicyAssignment'; SetParameterString = 'Az.Policy.custom\New-AzPolicyAssignment'; SetParameterObject = 'Az.Policy.custom\New-AzPolicyAssignment'; } if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('NameInternal')) { $PSBoundParameters['NameInternal'] = "PlaceholderName" } if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('ScopeInternal')) { $PSBoundParameters['ScopeInternal'] = /subscriptions/((Get-AzContext).Subscription.Id) } if (('CreateExpanded1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('IdInternal')) { $PSBoundParameters['IdInternal'] = "PlaceholderId" } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Gets policy assignments. .Description The **Get-AzPolicyAssignment** cmdlet gets all policy assignments or particular assignments. Identify a policy assignment to get by name and scope or by ID. .Example Get-AzPolicyAssignment .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' Get-AzPolicyAssignment -Name 'PolicyAssignment07' -Scope $ResourceGroup.ResourceId .Example $mgId = 'myManagementGroup' Get-AzPolicyAssignment -Scope '/providers/Microsoft.Management/managementgroups/$mgId' .Example Get-AzPolicyAssignment | Select-Object -Property Scope, PolicyDefinitionID, DisplayName | Format-List .Example Get-AzPolicyAssignment -BackwardCompatible | Select-Object -ExpandProperty properties | Select-Object -Property Scope, PolicyDefinitionID, DisplayName | Format-List .Inputs System.Management.Automation.SwitchParameter .Inputs System.String .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment .Link https://learn.microsoft.com/powershell/module/az.resources/get-azpolicyassignment #> function Get-AzPolicyAssignment { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='Default', PositionalBinding=$false)] param( [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the resource group that contains policy assignments. ${ResourceGroupName}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String[]] # The ID of the target subscription. ${SubscriptionId}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The parent resource path. # Use empty string if there is none. ${ParentResourcePath}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the resource. ${ResourceName}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The namespace of the resource provider. # For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) ${ResourceProviderNamespace}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The resource type name. # For example the type name of a web app is 'sites' (from Microsoft.Web/sites). ${ResourceType}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyAssignmentName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy assignment to get. ${Name}, [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='Scope', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='IncludeDescendent', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='PolicyDefinitionId', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # 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}' ${Scope}, [Parameter(ParameterSetName='IncludeDescendent', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.Management.Automation.SwitchParameter] # Get all policy assignments that target the given policy definition [fully qualified] ID. ${IncludeDescendent}, [Parameter(ParameterSetName='PolicyDefinitionId', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # Get all policy assignments that target the given policy definition [fully qualified] ID. ${PolicyDefinitionId}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('ResourceId', 'PolicyAssignmentId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the policy assignment to get. # Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. ${Id}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.Int32] # This switch is implemented and working, but confusing, since -Top is a misleading name. # Due to backend implementation # of $top, this parameter should actually be called -Pagesize. # Addressing this issue is beyond the scope of the initial # port to autorest: we will address this in the future and hide the parameter for now to avoid future backcompat complexity. # Maximum number of records to return. # When -Top is not provided, this cmdlet will return 500 or fewer records. ${Top}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.String] # The filter to apply on the operation. # Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. # If $filter is not provided, no filtering is performed. # If $filter=atScope() is provided, the returned list only includes all policy assignments that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. # If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the given scope. # If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value}. ${Filter}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Default = 'Az.Policy.custom\Get-AzPolicyAssignment'; Name = 'Az.Policy.custom\Get-AzPolicyAssignment'; Scope = 'Az.Policy.custom\Get-AzPolicyAssignment'; IncludeDescendent = 'Az.Policy.custom\Get-AzPolicyAssignment'; PolicyDefinitionId = 'Az.Policy.custom\Get-AzPolicyAssignment'; Id = 'Az.Policy.custom\Get-AzPolicyAssignment'; Top = 'Az.Policy.custom\Get-AzPolicyAssignment'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Gets policy set definitions. .Description The **Get-AzPolicySetDefinition** cmdlet gets a collection of policy set definitions or a specific policy set definition identified by name or ID. .Example Get-AzPolicyDefinition .Example Get-AzPolicyDefinition -Name 'VMPolicyDefinition' .Example Get-AzPolicyDefinition -Name 'VMPolicyDefinition' -ManagementGroupName 'Dept42' .Example Get-AzPolicyDefinition -SubscriptionId '3bf44b72-c631-427a-b8c8-53e2595398ca' -Builtin .Example Get-AzPolicyDefinition | Where-Object {$_.Properties.metadata.category -eq 'Tags'} .Example Get-AzPolicyDefinition | Select-Object -Property DisplayName, Description, PolicyType, Metadata | Format-List .Example Get-AzPolicyDefinition -BackwardCompatible | Select-Object -ExpandProperty properties | Select-Object -Property DisplayName, Description, PolicyType, Metadata | Format-List .Inputs System.Management.Automation.SwitchParameter .Inputs System.String .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinition .Link https://learn.microsoft.com/powershell/module/az.resources/get-azpolicydefinition #> function Get-AzPolicyDefinition { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinition])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SubscriptionId', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ManagementGroupName', ValueFromPipelineByPropertyName)] [Alias('PolicyDefinitionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy definition to get. ${Name}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='Static', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='Custom', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='BuiltIn', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='Static', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='Custom', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='BuiltIn', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the management group. ${ManagementGroupName}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('ResourceId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The full Id of the policy definition to get. ${Id}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.Int32] # This switch is implemented and working, but confusing, since -Top is a misleading name. # Due to backend implementation # of $top, this parameter should actually be called -Pagesize. # Addressing this issue is beyond the scope of the initial # port to autorest: we will address this in the future and hide the parameter for now to avoid future backcompat complexity. # Maximum number of records to return. # When -Top is not provided, this cmdlet will return 500 or fewer records. ${Top}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.String] # The filter to apply on the operation. # Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. # If $filter is not provided, no filtering is performed. # If $filter=atExactScope() is provided, the returned list only includes all policy definitions that at the given scope. # If $filter='policyType -eq {value}' is provided, the returned list only includes all policy definitions whose type match the {value}. # Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. # If $filter='category -eq {value}' is provided, the returned list only includes all policy definitions whose category match the {value}. ${Filter}, [Parameter(ParameterSetName='Static', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return only static policy definitions. ${Static}, [Parameter(ParameterSetName='Custom', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return only custom policy definitions. ${Custom}, [Parameter(ParameterSetName='BuiltIn', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return only built-in policy definitions. ${BuiltIn}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The credentials, account, tenant, and subscription used for communication with Azure. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Get-AzPolicyDefinition'; SubscriptionId = 'Az.Policy.custom\Get-AzPolicyDefinition'; ManagementGroupName = 'Az.Policy.custom\Get-AzPolicyDefinition'; Id = 'Az.Policy.custom\Get-AzPolicyDefinition'; Static = 'Az.Policy.custom\Get-AzPolicyDefinition'; Custom = 'Az.Policy.custom\Get-AzPolicyDefinition'; BuiltIn = 'Az.Policy.custom\Get-AzPolicyDefinition'; Top = 'Az.Policy.custom\Get-AzPolicyDefinition'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Gets policy exemptions. .Description The **Get-AzPolicyExemption** cmdlet gets a collection of policy exemptions or a specific policy exemption identified by name or ID. .Example Get-AzPolicyExemption .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' Get-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId .Example $Assignment = Get-AzPolicyAssignment -Name 'PolicyAssignment07' Get-AzPolicyExemption -PolicyAssignmentIdFilter $Assignment.ResourceId .Inputs System.Management.Automation.SwitchParameter .Inputs System.String .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220701Preview.IPolicyExemption .Link https://learn.microsoft.com/powershell/module/az.resources/get-azpolicyexemption #> function Get-AzPolicyExemption { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220701Preview.IPolicyExemption])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Alias('PolicyExemptionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy exemption. ${Name}, [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='IncludeDescendent', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The scope of the policy exemption. # 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}' ${Scope}, [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='Id', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The policy assignment id filter. ${PolicyAssignmentIdFilter}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String[]] # The ID of the target subscription. ${SubscriptionId}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the resource group containing the resource. ${ResourceGroupName}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The parent resource path. # Use empty string if there is none. ${ParentResourcePath}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the resource. ${ResourceName}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The namespace of the resource provider. # For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) ${ResourceProviderNamespace}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The resource type name. # For example the type name of a web app is 'sites' (from Microsoft.Web/sites). ${ResourceType}, [Parameter(ParameterSetName='IncludeDescendent', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.Management.Automation.SwitchParameter] # Causes the list of returned policy exemptions to include all exemptions related to the given scope, including those from ancestor scopes and those from descendent scopes. ${IncludeDescendent}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('ResourceId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The fully qualified resource Id of the exemption. ${Id}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.String] # The filter to apply on the operation. # Valid values for $filter are: 'atScope()', 'atExactScope()', 'excludeExpired()' or 'policyAssignmentId eq '{value}''. # If $filter is not provided, no filtering is performed. # If $filter is not provided, the unfiltered list includes all policy exemptions associated with the scope, including those that apply directly or apply from containing scopes. # If $filter=atScope() is provided, the returned list only includes all policy exemptions that apply to the scope, which is everything in the unfiltered list except those applied to sub scopes contained within the given scope. # If $filter=atExactScope() is provided, the returned list only includes all policy exemptions that at the given scope. # If $filter=excludeExpired() is provided, the returned list only includes all policy exemptions that either haven't expired or didn't set expiration date. # If $filter=policyAssignmentId eq '{value}' is provided. # the returned list only includes all policy exemptions that are associated with the give policyAssignmentId. ${Filter}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Get-AzPolicyExemption'; IncludeDescendent = 'Az.Policy.custom\Get-AzPolicyExemption'; Id = 'Az.Policy.custom\Get-AzPolicyExemption'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Gets policy set definitions. .Description The **Get-AzPolicySetDefinition** cmdlet gets a collection of policy set definitions or a specific policy set definition identified by name or ID. .Example Get-AzPolicySetDefinition .Example Get-AzPolicySetDefinition -Name 'VMPolicySetDefinition' .Example Get-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -subscriptionId '3bf44b72-c631-427a-b8c8-53e2595398ca' .Example Get-AzPolicySetDefinition -ManagementGroupName 'Dept42' -Custom .Example Get-AzPolicySetDefinition | Where-Object {$_.metadata.category -eq "Virtual Machine"} .Example Get-AzPolicySetDefinition -BackwardCompatible | Where-Object {$_.Properties.metadata.category -eq "Virtual Machine"} .Inputs System.Management.Automation.SwitchParameter .Inputs System.String .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinition .Link https://learn.microsoft.com/powershell/module/az.resources/get-azpolicysetdefinition #> function Get-AzPolicySetDefinition { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinition])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SubscriptionId', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ManagementGroupName', ValueFromPipelineByPropertyName)] [Alias('PolicySetDefinitionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy definition to get. ${Name}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='Custom', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='BuiltIn', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='Custom', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='BuiltIn', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the management group. ${ManagementGroupName}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('ResourceId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The full Id of the policy definition to get. ${Id}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.Int32] # This switch is implemented and working, but confusing, since -Top is a misleading name. # Due to backend implementation # of $top, this parameter should actually be called -Pagesize. # Addressing this is beyond the scope of the initial port # to autorest: we will address this in the future and hide the parameter for now to avoid future backcompat complexity. # Maximum number of records to return. # When -Top is not provided, this cmdlet will return 500 or fewer records. ${Top}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.String] # The filter to apply on the operation. # Valid values for $filter are: 'atExactScope()', 'policyType -eq {value}' or 'category eq '{value}''. # If $filter is not provided, no filtering is performed. # If $filter=atExactScope() is provided, the returned list only includes all policy set definitions that at the given scope. # If $filter='policyType -eq {value}' is provided, the returned list only includes all policy set definitions whose type match the {value}. # Possible policyType values are NotSpecified, BuiltIn, Custom, and Static. # If $filter='category -eq {value}' is provided, the returned list only includes all policy set definitions whose category match the {value}. ${Filter}, [Parameter(ParameterSetName='Custom', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return only custom policy definitions. ${Custom}, [Parameter(ParameterSetName='BuiltIn', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Query')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return only built-in policy definitions. ${BuiltIn}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Get-AzPolicySetDefinition'; SubscriptionId = 'Az.Policy.custom\Get-AzPolicySetDefinition'; ManagementGroupName = 'Az.Policy.custom\Get-AzPolicySetDefinition'; Id = 'Az.Policy.custom\Get-AzPolicySetDefinition'; Custom = 'Az.Policy.custom\Get-AzPolicySetDefinition'; BuiltIn = 'Az.Policy.custom\Get-AzPolicySetDefinition'; Top = 'Az.Policy.custom\Get-AzPolicySetDefinition'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Creates or updates a policy definition. .Description The **New-AzPolicyDefinition** cmdlet creates or updates a policy definition that includes a policy rule JSON format. .Example { "if": { "field": "location", "notIn": ["eastus", "westus", "centralus"] }, "then": { "effect": "audit" } } New-AzPolicyDefinition -Name 'LocationDefinition' -Policy C:\LocationPolicy.json .Example { "if": { "field": "location", "notIn": "[parameters('listOfAllowedLocations')]" }, "then": { "effect": "audit" } } New-AzPolicyDefinition -Name 'LocationDefinition' -Policy C:\LocationPolicy.json -Parameter '{ "listOfAllowedLocations": { "type": "array" } }' .Example New-AzPolicyDefinition -Name 'VMPolicyDefinition' -ManagementGroupName Dept42 -DisplayName 'Virtual Machine policy definition' -Policy '{"if":{"field":"type","equals":"Microsoft.Compute/virtualMachines"},"then":{"effect":"deny"}}' .Example New-AzPolicyDefinition -Name 'VMPolicyDefinition' -Metadata '{"category":"Virtual Machine"}' -Policy '{"if":{"field":"type","equals":"Microsoft.Compute/virtualMachines"},"then":{"effect":"deny"}}' | Format-List .Example New-AzPolicyDefinition -Name 'TagsPolicyDefinition' -Policy '{"if":{"value":"[less(length(field(''tags'')), 3)]","equals":true},"then":{"effect":"deny"}}' -Mode Indexed .Inputs System.String .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinition .Link https://learn.microsoft.com/powershell/module/az.resources/new-azpolicydefinition #> function New-AzPolicyDefinition { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinition])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyDefinitionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy definition to create. ${Name}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # This parameter is generated by autorest, but not yet supported. # Fully implementing it is beyond the scope of # the initial port to autorest: we are hiding this for now and will implement it in a future PR. # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the management group. ${ManagementGroupName}, [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The policy rule. ${Policy}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The display name of the policy definition. ${DisplayName}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The policy definition description. ${Description}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinitionPropertiesMetadata]))] [System.String] # The policy definition metadata. # Metadata is an open ended object and is typically a collection of key value pairs. ${Metadata}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IParameterDefinitions]))] [System.String] # The parameter definitions for parameters used in the policy rule. # The keys are the parameter names. ${Parameter}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The policy definition mode. # Some examples are All, Indexed, Microsoft.KeyVault.Data. ${Mode}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\New-AzPolicyDefinition'; ManagementGroupName = 'Az.Policy.custom\New-AzPolicyDefinition'; SubscriptionId = 'Az.Policy.custom\New-AzPolicyDefinition'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Creates or updates a policy exemption. .Description The **New-AzPolicyExemption** cmdlet creates a policy exemption with the given scope and name. .Example $Subscription = Get-AzSubscription -SubscriptionName 'Subscription01' $Assignment = Get-AzPolicyAssignment -Name 'VirtualMachinePolicyAssignment' New-AzPolicyExemption -Name 'VirtualMachinePolicyExemption' -PolicyAssignment $Assignment -Scope "/subscriptions/$($Subscription.Id)" -ExemptionCategory Waiver .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $Assignment = Get-AzPolicyAssignment -Name 'VirtualMachinePolicyAssignment' New-AzPolicyExemption -Name 'VirtualMachinePolicyAssignment' -PolicyAssignment $Assignment -Scope $ResourceGroup.ResourceId -ExemptionCategory Mitigated .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.AssignmentScopeValidation .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.ExemptionCategory .Inputs System.Management.Automation.PSObject .Inputs System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] .Inputs System.String .Inputs System.String[] .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220701Preview.IPolicyExemption .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. POLICYASSIGNMENT <PSObject>: The policy assignment id filter. [Description <String>]: This message will be part of response in case of policy violation. [DisplayName <String>]: The display name of the policy assignment. [EnforcementMode <EnforcementMode?>]: The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. [IdentityType <ResourceIdentityType?>]: The identity type. This is the only required field when adding a system or user assigned identity to a resource. [IdentityUserAssignedIdentity <IIdentityUserAssignedIdentities>]: The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. [(Any) <IUserAssignedIdentitiesValue>]: This indicates any property can be added to this object. [Location <String>]: The location of the policy assignment. Only required when utilizing managed identity. [Metadata <IPolicyAssignmentPropertiesMetadata>]: The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. [(Any) <Object>]: This indicates any property can be added to this object. [NonComplianceMessage <INonComplianceMessage[]>]: The messages that describe why a resource is non-compliant with the policy. 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. [SystemDataLastModifiedAt <DateTime?>]: The timestamp of resource last modification (UTC) [SystemDataLastModifiedBy <String>]: The identity that last modified the resource. [SystemDataLastModifiedByType <CreatedByType?>]: The type of identity that last modified the resource. .Link 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', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Position=0, Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyExemptionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy exemption. ${Name}, [Parameter(Position=5, Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.ExemptionCategory] # The policy exemption category ${ExemptionCategory}, [Parameter(Position=6, Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment]))] [System.Management.Automation.PSObject] # The policy assignment id filter. # To construct, see NOTES section for POLICYASSIGNMENT properties and create a hash table. ${PolicyAssignment}, [Parameter(Position=1, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The scope of the policy exemption. # 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}' ${Scope}, [Parameter(Position=7, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String[]] # The policy definition reference ID list when the associated policy assignment is for a policy set (initiative). ${PolicyDefinitionReferenceId}, [Parameter(Position=2, ValueFromPipelineByPropertyName)] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.AssignmentScopeValidation])] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.AssignmentScopeValidation] # Whether to validate the exemption is at or under the assignment scope. ${AssignmentScopeValidation}, [Parameter(Position=3, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The display name of the policy assignment. ${DisplayName}, [Parameter(Position=4, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # This message will be part of response in case of policy violation. ${Description}, [Parameter(Position=8, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Nullable[System.DateTime]] # The expiration date and time (in UTC ISO 8601 format yyyy-MM-ddTHH:mm:ssZ) of the policy exemption. ${ExpiresOn}, [Parameter(Position=9, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220701Preview.IPolicyExemptionPropertiesMetadata]))] [System.String] # The policy assignment metadata. # Metadata is an open ended object and is typically a collection of key value pairs. ${Metadata}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter(Position=10)] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(Position=11, DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(Position=12, DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(Position=13, DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(Position=14, DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Default = 'Az.Policy.custom\New-AzPolicyExemption'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis Creates or updates a policy set definition. .Description The **New-AzPolicySetDefinition** cmdlet creates or updates a policy set definition in the given subscription or management group with the given name. .Example [ { "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/2a0e14a6-b0a6-4fab-991a-187a4f81c498", "parameters": { "tagName": { "value": "Business Unit" }, "tagValue": { "value": "Finance" } } }, { "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/464dbb85-3d5f-4a1d-bb09-95a9b5dd19cf" } ] New-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -Metadata '{"category":"Virtual Machine"}' -PolicyDefinition C:\VMPolicySet.json .Example [ { "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/2a0e14a6-b0a6-4fab-991a-187a4f81c498", "parameters": { "tagName": { "value": "Business Unit" }, "tagValue": { "value": "[parameters('buTagValue')]" } } }, { "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/464dbb85-3d5f-4a1d-bb09-95a9b5dd19cf" } ] New-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -PolicyDefinition C:\VMPolicySet.json -Parameter '{ "buTagValue": { "type": "string" } }' .Example [ { "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/2a0e14a6-b0a6-4fab-991a-187a4f81c498", "groupNames": [ "group1" ] }, { "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/464dbb85-3d5f-4a1d-bb09-95a9b5dd19cf", "groupNames": [ "group2" ] } ] $groupsJson = ConvertTo-Json @{ name = "group1" }, @{ name = "group2" } New-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -GroupDefinition $groupsJson -PolicyDefinition C:\VMPolicySet.json .Inputs System.String .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinition .Link https://learn.microsoft.com/powershell/module/az.resources/new-azpolicysetdefinition #> function New-AzPolicySetDefinition { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinition])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicySetDefinitionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy set definition to create. ${Name}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # This parameter is generated by autorest, but not yet supported. # Fully implementing it is beyond the scope of # the initial port to autorest: we are hiding this for now and will implement it in a future PR. # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the management group. ${ManagementGroupName}, [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinitionReference[]]))] # The policy definition array in JSON string form. ${PolicyDefinition}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The display name of the policy set definition. ${DisplayName}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The policy set definition description. ${Description}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinitionPropertiesMetadata]))] [System.String] # The policy set definition metadata. # Metadata is an open ended object and is typically a collection of key value pairs. ${Metadata}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IParameterDefinitions]))] # The parameter definitions for parameters used in the policy rule. # The keys are the parameter names. ${Parameter}, [Parameter()] [Alias('GroupDefinition')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinitionGroup[]]))] [System.String] # The metadata describing groups of policy definition references within the policy set definition. ${PolicyDefinitionGroup}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\New-AzPolicySetDefinition'; ManagementGroupName = 'Az.Policy.custom\New-AzPolicySetDefinition'; SubscriptionId = 'Az.Policy.custom\New-AzPolicySetDefinition'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy assignment is the part of its ID preceding '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. .Description This operation deletes a policy assignment, given its name and the scope it was created in. The scope of a policy assignment is the part of its ID preceding '/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' Remove-AzPolicyAssignment -Name 'PolicyAssignment07' -Scope $ResourceGroup.ResourceId -Force .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment07' -Scope $ResourceGroup.ResourceId Remove-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -Confirm:$false .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment07' -Scope $ResourceGroup.ResourceId Remove-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -Confirm:$false -BackwardCompatible True .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity .Inputs System.String .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <IPolicyIdentity>: Identity Parameter [Id <String>]: Resource identity path [ManagementGroupId <String>]: The ID of the management group. [ParentResourcePath <String>]: The parent resource path. Use empty string if there is none. [PolicyAssignmentId <String>]: The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. [PolicyAssignmentName <String>]: The name of the policy assignment to delete. [PolicyDefinitionName <String>]: The name of the policy definition to create. [PolicyExemptionName <String>]: The name of the policy exemption to delete. [PolicySetDefinitionName <String>]: The name of the policy set definition to create. [ResourceGroupName <String>]: The name of the resource group that contains policy assignments. [ResourceName <String>]: The name of the resource. [ResourceProviderNamespace <String>]: The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) [ResourceType <String>]: The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). [Scope <String>]: 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}' [SubscriptionId <String>]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.resources/remove-azpolicyassignment #> function Remove-AzPolicyAssignment { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyAssignmentName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy assignment to delete. ${Name}, [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # 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}' ${Scope}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyAssignmentId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the policy assignment to delete. # Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. ${Id}, [Parameter(ParameterSetName='InputObject', Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # When $true, skip confirmation prompts ${Force}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Remove-AzPolicyAssignment'; Id = 'Az.Policy.custom\Remove-AzPolicyAssignment'; InputObject = 'Az.Policy.custom\Remove-AzPolicyAssignment'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis This operation deletes the policy definition in the given subscription with the given name. .Description This operation deletes the policy definition in the given subscription with the given name. .Example Remove-AzPolicyDefinition -Name 'VMPolicyDefinition' .Example $PolicyDefinition = Get-AzPolicyDefinition -Name 'VMPolicyDefinition' Remove-AzPolicyDefinition -Id $PolicyDefinition.ResourceId -Force .Example $PolicyDefinition = Get-AzPolicyDefinition -Name 'VMPolicyDefinition' Remove-AzPolicyDefinition -Id $PolicyDefinition.ResourceId -Force -BackwardCompatible True .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity .Inputs System.String .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <IPolicyIdentity>: Identity Parameter [Id <String>]: Resource identity path [ManagementGroupId <String>]: The ID of the management group. [ParentResourcePath <String>]: The parent resource path. Use empty string if there is none. [PolicyAssignmentId <String>]: The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. [PolicyAssignmentName <String>]: The name of the policy assignment to delete. [PolicyDefinitionName <String>]: The name of the policy definition to create. [PolicyExemptionName <String>]: The name of the policy exemption to delete. [PolicySetDefinitionName <String>]: The name of the policy set definition to create. [ResourceGroupName <String>]: The name of the resource group that contains policy assignments. [ResourceName <String>]: The name of the resource. [ResourceProviderNamespace <String>]: The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) [ResourceType <String>]: The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). [Scope <String>]: 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}' [SubscriptionId <String>]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.resources/remove-azpolicydefinition #> function Remove-AzPolicyDefinition { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SubscriptionId', Mandatory)] [Parameter(ParameterSetName='ManagementGroupName', Mandatory)] [Alias('PolicyDefinitionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy definition to get. ${Name}, [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the management group. ${ManagementGroupName}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('ResourceId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The full Id of the policy definition to get. ${Id}, [Parameter(ParameterSetName='InputObject', Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # When $true, skip confirmation prompts ${Force}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Remove-AzPolicyDefinition'; SubscriptionId = 'Az.Policy.custom\Remove-AzPolicyDefinition'; ManagementGroupName = 'Az.Policy.custom\Remove-AzPolicyDefinition'; Id = 'Az.Policy.custom\Remove-AzPolicyDefinition'; InputObject = 'Az.Policy.custom\Remove-AzPolicyDefinition'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis This operation deletes a policy exemption, given its name and the scope it was created in. The scope of a policy exemption is the part of its ID preceding '/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}'. .Description This operation deletes a policy exemption, given its name and the scope it was created in. The scope of a policy exemption is the part of its ID preceding '/providers/Microsoft.Authorization/policyExemptions/{policyExemptionName}'. .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' Remove-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId -Confirm .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId Remove-AzPolicyExemption -Id $PolicyExemption.ResourceId -Confirm .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId Remove-AzPolicyExemption -Id $PolicyExemption.ResourceId -Force -BackwardCompatible True .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity .Inputs System.String .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <IPolicyIdentity>: Identity Parameter [Id <String>]: Resource identity path [ManagementGroupId <String>]: The ID of the management group. [ParentResourcePath <String>]: The parent resource path. Use empty string if there is none. [PolicyAssignmentId <String>]: The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. [PolicyAssignmentName <String>]: The name of the policy assignment to delete. [PolicyDefinitionName <String>]: The name of the policy definition to create. [PolicyExemptionName <String>]: The name of the policy exemption to delete. [PolicySetDefinitionName <String>]: The name of the policy set definition to create. [ResourceGroupName <String>]: The name of the resource group that contains policy assignments. [ResourceName <String>]: The name of the resource. [ResourceProviderNamespace <String>]: The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) [ResourceType <String>]: The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). [Scope <String>]: 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}' [SubscriptionId <String>]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.resources/remove-azpolicyexemption #> function Remove-AzPolicyExemption { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyExemptionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy exemption to delete. ${Name}, [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The scope of the policy exemption. # 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}' ${Scope}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyAssignmentId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the policy assignment to delete. # Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. ${Id}, [Parameter(ParameterSetName='InputObject', Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # When $true, skip confirmation prompts ${Force}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Remove-AzPolicyExemption'; Id = 'Az.Policy.custom\Remove-AzPolicyExemption'; InputObject = 'Az.Policy.custom\Remove-AzPolicyExemption'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis This operation deletes the policy definition in the given subscription with the given name. .Description This operation deletes the policy definition in the given subscription with the given name. .Example $PolicySetDefinition = Get-AzPolicySetDefinition -ResourceId '/subscriptions/mySub/Microsoft.Authorization/policySetDefinitions/myPSSetDefinition' Remove-AzPolicySetDefinition -Id $PolicySetDefinition.ResourceId -Force .Example $PolicySetDefinition = Get-AzPolicySetDefinition -ResourceId '/subscriptions/mySub/Microsoft.Authorization/policySetDefinitions/myPSSetDefinition' Remove-AzPolicySetDefinition -Id $PolicySetDefinition.ResourceId -Force -BackwardCompatible True .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity .Inputs System.String .Outputs System.Boolean .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT <IPolicyIdentity>: Identity Parameter [Id <String>]: Resource identity path [ManagementGroupId <String>]: The ID of the management group. [ParentResourcePath <String>]: The parent resource path. Use empty string if there is none. [PolicyAssignmentId <String>]: The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. [PolicyAssignmentName <String>]: The name of the policy assignment to delete. [PolicyDefinitionName <String>]: The name of the policy definition to create. [PolicyExemptionName <String>]: The name of the policy exemption to delete. [PolicySetDefinitionName <String>]: The name of the policy set definition to create. [ResourceGroupName <String>]: The name of the resource group that contains policy assignments. [ResourceName <String>]: The name of the resource. [ResourceProviderNamespace <String>]: The namespace of the resource provider. For example, the namespace of a virtual machine is Microsoft.Compute (from Microsoft.Compute/virtualMachines) [ResourceType <String>]: The resource type name. For example the type name of a web app is 'sites' (from Microsoft.Web/sites). [Scope <String>]: 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}' [SubscriptionId <String>]: The ID of the target subscription. .Link https://learn.microsoft.com/powershell/module/az.resources/remove-azpolicysetdefinition #> function Remove-AzPolicySetDefinition { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SubscriptionId', Mandatory)] [Parameter(ParameterSetName='ManagementGroupName', Mandatory)] [Alias('PolicySetDefinitionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy definition to get. ${Name}, [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the management group. ${ManagementGroupName}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('ResourceId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The full Id of the policy definition to get. ${Id}, [Parameter(ParameterSetName='InputObject', Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # When $true, skip confirmation prompts ${Force}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Returns true when the command succeeds ${PassThru}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Remove-AzPolicySetDefinition'; SubscriptionId = 'Az.Policy.custom\Remove-AzPolicySetDefinition'; ManagementGroupName = 'Az.Policy.custom\Remove-AzPolicySetDefinition'; Id = 'Az.Policy.custom\Remove-AzPolicySetDefinition'; InputObject = 'Az.Policy.custom\Remove-AzPolicySetDefinition'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis This operation updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group. .Description This operation updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group. .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' -Scope $ResourceGroup.ResourceId Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -DisplayName 'Do not allow VM creation' .Example $PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -IdentityType 'SystemAssigned' -Location 'westus' .Example $PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' $UserAssignedIdentity = Get-AzUserAssignedIdentity -ResourceGroupName 'ResourceGroup1' -Name 'UserAssignedIdentity1' Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -IdentityType 'UserAssigned' -Location 'westus' -IdentityId $UserAssignedIdentity.Id .Example $Locations = Get-AzLocation | Where-Object {($_.displayname -like 'france*') -or ($_.displayname -like 'uk*')} $AllowedLocations = @{'listOfAllowedLocations'=($Locations.location)} $PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -PolicyParameterObject $AllowedLocations .Example { "listOfAllowedLocations": { "value": [ "uksouth", "ukwest", "francecentral", "francesouth" ] } } Update-AzPolicyAssignment -Name 'PolicyAssignment' -PolicyParameter .\AllowedLocations.json .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' -Scope $ResourceGroup.ResourceId Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -EnforcementMode Default .Example $PolicyAssignment = Get-AzPolicyAssignment -Name 'VirtualMachinePolicy' Update-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -NonComplianceMessage @{Message="All resources must follow resource naming guidelines."} .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $PolicyAssignment = Get-AzPolicyAssignment -Name 'PolicyAssignment' -Scope $ResourceGroup.ResourceId Set-AzPolicyAssignment -Id $PolicyAssignment.ResourceId -EnforcementMode Default .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.EnforcementMode .Inputs System.Management.Automation.PSObject[] .Inputs System.String .Inputs System.String[] .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment .Link https://learn.microsoft.com/powershell/module/az.resources/update-azpolicyassignment #> function Update-AzPolicyAssignment { [Alias('Set-AzPolicyAssignment')] [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignment])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='NameParameterString', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='NameParameterObject', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyAssignmentName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy assignment. ${Name}, [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='NameParameterString', ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='NameParameterObject', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # 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}' ${Scope}, [Parameter(ParameterSetName='IdParameterString', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='IdParameterObject', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipeline)] [Alias('ResourceId', 'PolicyAssignmentId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the policy assignment to update. # Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. ${Id}, [Parameter(ValueFromPipelineByPropertyName)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String[]] # The policy's excluded scopes. ${NotScope}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The display name of the policy assignment. ${DisplayName}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # This message will be part of response in case of policy violation. ${Description}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.IPolicyAssignmentPropertiesMetadata]))] [System.String] # The policy assignment metadata. # Metadata is an open ended object and is typically a collection of key value pairs. ${Metadata}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The location of the policy assignment. # Only required when utilizing managed identity. ${Location}, [Parameter(ValueFromPipelineByPropertyName)] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.EnforcementMode])] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.EnforcementMode] # The policy assignment enforcement mode. # Possible values are Default and DoNotEnforce. ${EnforcementMode}, [Parameter()] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.ResourceIdentityType])] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.ResourceIdentityType] # The identity type. # This is the only required field when adding a system or user assigned identity to a resource. ${IdentityType}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The user identity associated with the policy. # The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. ${IdentityId}, [Parameter(ValueFromPipelineByPropertyName)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220601.INonComplianceMessage[]]))] [System.Management.Automation.PSObject[]] # The messages that describe why a resource is non-compliant with the policy. ${NonComplianceMessage}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter(ParameterSetName='NameParameterString', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='IdParameterString', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The parameter values for the assigned policy rule. # The keys are the parameter names. ${PolicyParameter}, [Parameter(ParameterSetName='NameParameterObject', Mandatory)] [Parameter(ParameterSetName='IdParameterObject', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.PSObject] # The parameter values for the assigned policy rule. # The keys are the parameter names. ${PolicyParameterObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Update-AzPolicyAssignment'; NameParameterString = 'Az.Policy.custom\Update-AzPolicyAssignment'; NameParameterObject = 'Az.Policy.custom\Update-AzPolicyAssignment'; IdParameterString = 'Az.Policy.custom\Update-AzPolicyAssignment'; IdParameterObject = 'Az.Policy.custom\Update-AzPolicyAssignment'; Id = 'Az.Policy.custom\Update-AzPolicyAssignment'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis This operation updates an existing policy definition in the given subscription or management group with the given name. .Description This operation updates an existing policy definition in the given subscription or management group with the given name. .Example $PolicyDefinition = Get-AzPolicyDefinition -Name 'VMPolicyDefinition' Update-AzPolicyDefinition -Id $PolicyDefinition.ResourceId -Description 'Updated policy to not allow virtual machine creation' .Example Update-AzPolicyDefinition -Name 'VMPolicyDefinition' -Mode 'All' .Example Update-AzPolicyDefinition -Name 'VMPolicyDefinition' -Metadata '{"category":"Virtual Machine"}' .Example Set-AzPolicyDefinition -Name 'VMPolicyDefinition' -Mode 'All' .Inputs System.String .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinition .Link https://learn.microsoft.com/powershell/module/az.resources/update-azpolicydefinition #> function Update-AzPolicyDefinition { [Alias('Set-AzPolicyDefinition')] [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinition])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyDefinitionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy definition to update. ${Name}, [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the management group. ${ManagementGroupName}, [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('ResourceId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The resource Id of the policy definition to update. ${Id}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The display name of the policy definition. ${DisplayName}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The policy definition description. ${Description}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The policy rule. ${Policy}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinitionPropertiesMetadata]))] [System.String] # The policy definition metadata. # Metadata is an open ended object and is typically a collection of key value pairs. ${Metadata}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IParameterDefinitions]))] [System.String] # The parameter definitions for parameters used in the policy rule. # The keys are the parameter names. ${Parameter}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The policy definition mode. # Some examples are All, Indexed, Microsoft.KeyVault.Data. ${Mode}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Update-AzPolicyDefinition'; ManagementGroupName = 'Az.Policy.custom\Update-AzPolicyDefinition'; SubscriptionId = 'Az.Policy.custom\Update-AzPolicyDefinition'; Id = 'Az.Policy.custom\Update-AzPolicyDefinition'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis This operation updates a policy exemption with the given scope and name. .Description This operation updates a policy exemption with the given scope and name. .Example $ResourceGroup = Get-AzResourceGroup -Name 'ResourceGroup11' $PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' -Scope $ResourceGroup.ResourceId Update-AzPolicyExemption -Id $PolicyExemption.ResourceId -DisplayName 'Exempt VM creation limit' .Example $NextMonth = (Get-Date).AddMonths(1) $PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' Update-AzPolicyExemption -Id $PolicyExemption.ResourceId -ExpiresOn $NextMonth .Example $PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' Update-AzPolicyExemption -Id $PolicyExemption.ResourceId -ClearExpiration .Example $PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' Update-AzPolicyExemption -Id $PolicyExemption.ResourceId -ExemptionCategory Mitigated .Example $PolicyExemption = Get-AzPolicyExemption -Name 'PolicyExemption07' Set-AzPolicyExemption -Id $PolicyExemption.ResourceId -ClearExpiration .Inputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.ExemptionCategory .Inputs System.Management.Automation.SwitchParameter .Inputs System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] .Inputs System.String .Inputs System.String[] .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220701Preview.IPolicyExemption .Link https://learn.microsoft.com/powershell/module/az.resources/update-azpolicyexemption #> function Update-AzPolicyExemption { [Alias('Set-AzPolicyExemption')] [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220701Preview.IPolicyExemption])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicyExemptionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy exemption. ${Name}, [Parameter(ParameterSetName='Name', ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The scope of the policy exemption. # 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}' ${Scope}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.ExemptionCategory] # The policy exemption category ${ExemptionCategory}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String[]] # The policy definition reference ID list when the associated policy assignment is for a policy set (initiative). ${PolicyDefinitionReferenceId}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('ResourceId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the policy assignment to delete. # Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. ${Id}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The display name of the policy assignment. ${DisplayName}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # This message will be part of response in case of policy violation. ${Description}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Nullable[System.DateTime]] # The expiration date and time (in UTC ISO 8601 format yyyy-MM-ddTHH:mm:ssZ) of the policy exemption. ${ExpiresOn}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether to clear the expiration date and time of the policy exemption. ${ClearExpiration}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20220701Preview.IPolicyExemptionPropertiesMetadata]))] [System.String] # The policy assignment metadata. # Metadata is an open ended object and is typically a collection of key value pairs. ${Metadata}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.AssignmentScopeValidation])] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Support.AssignmentScopeValidation] # The option whether validate the exemption is at or under the assignment scope. ${AssignmentScopeValidation}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Update-AzPolicyExemption'; Id = 'Az.Policy.custom\Update-AzPolicyExemption'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } <# .Synopsis This operation updates an existing policy set definition in the given subscription or management group with the given name. .Description This operation updates an existing policy set definition in the given subscription or management group with the given name. .Example $PolicySetDefinition = Get-AzPolicySetDefinition -ResourceId '/subscriptions/mySub/Microsoft.Authorization/policySetDefinitions/myPSSetDefinition' Update-AzPolicySetDefinition -Id $PolicySetDefinition.ResourceId -Description 'Updated policy to not allow virtual machine creation' .Example Update-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -Metadata '{"category":"Virtual Machine"}' .Example Update-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -GroupDefinition '[{ "name": "group1", "displayName": "Virtual Machine Security" }, { "name": "group2" }]' .Example $groupsJson = ConvertTo-Json @{ name = "group1"; displayName = "Virtual Machine Security" }, @{ name = "group2" } Update-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -GroupDefinition $groupsJson .Example Set-AzPolicySetDefinition -Name 'VMPolicySetDefinition' -Metadata '{"category":"Virtual Machine"}' .Inputs System.String .Outputs Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinition .Link https://learn.microsoft.com/powershell/module/az.resources/update-azpolicysetdefinition #> function Update-AzPolicySetDefinition { [Alias('Set-AzPolicySetDefinition')] [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinition])] [CmdletBinding(DefaultParameterSetName='Name', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Name', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Alias('PolicySetDefinitionName')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The name of the policy set definition to update. ${Name}, [Parameter(ParameterSetName='SubscriptionId', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the target subscription. ${SubscriptionId}, [Parameter(ParameterSetName='ManagementGroupName', Mandatory, ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The ID of the management group. ${ManagementGroupName}, [Parameter(ParameterSetName='Id', Mandatory, ValueFromPipelineByPropertyName)] [Alias('ResourceId')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Path')] [System.String] # The resource Id of the policy definition to update. ${Id}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The display name of the policy set definition. ${DisplayName}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # The policy set definition description. ${Description}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinitionReference[]]))] [System.String] # The policy definition array in JSON string form. ${PolicyDefinition}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicySetDefinitionPropertiesMetadata]))] [System.String] # The policy set definition metadata. # Metadata is an open ended object and is typically a collection of key value pairs. ${Metadata}, [Parameter(ValueFromPipelineByPropertyName)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.String] # [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IParameterDefinitions]))] # The parameter definitions for parameters used in the policy set. # The keys are the parameter names. ${Parameter}, [Parameter()] [Alias('GroupDefinition')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.Api20210601.IPolicyDefinitionGroup[]]))] [System.String] # The metadata describing groups of policy definition references within the policy set definition. ${PolicyDefinitionGroup}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Body')] [System.Management.Automation.SwitchParameter] # Causes cmdlet to return artifacts using legacy format placing policy-specific properties in a property bag object. ${BackwardCompatible}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Azure')] [System.Management.Automation.PSObject] # The DefaultProfile parameter is not functional. # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Wait for .NET debugger to attach ${Break}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be appended to the front of the pipeline ${HttpPipelineAppend}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.SendAsyncStep[]] # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Uri] # The URI for the proxy server to use ${Proxy}, [Parameter(DontShow)] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.PSCredential] # Credentials for a proxy server to use for the remote call ${ProxyCredential}, [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Category('Runtime')] [System.Management.Automation.SwitchParameter] # Use the default credentials for the proxy ${ProxyUseDefaultCredentials} ) begin { try { $outBuffer = $null if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) } else { $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets if ($internalCalledCmdlets -eq '') { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name } else { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' } $mapping = @{ Name = 'Az.Policy.custom\Update-AzPolicySetDefinition'; SubscriptionId = 'Az.Policy.custom\Update-AzPolicySetDefinition'; ManagementGroupName = 'Az.Policy.custom\Update-AzPolicySetDefinition'; Id = 'Az.Policy.custom\Update-AzPolicySetDefinition'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ [Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } process { try { $steppablePipeline.Process($_) } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } finally { $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } } end { try { $steppablePipeline.End() [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets if ($preTelemetryId -eq '') { [Microsoft.Azure.PowerShell.Cmdlets.Policy.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() } [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId } catch { [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() throw } } } # SIG # Begin signature block # MIInvgYJKoZIhvcNAQcCoIInrzCCJ6sCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCD3m1aIuVq/PWLf # 5X70tjMOmsxSZRtkaUPEv5nJCGxoN6CCDXYwggX0MIID3KADAgECAhMzAAADTrU8 # esGEb+srAAAAAANOMA0GCSqGSIb3DQE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IgQga+McKkScFDJgTT8dHUzbk5RRielV8ySZ4R3Ym9sFho0w # DQYJKoZIhvcNAQELBQAEggIAWdkL0eiTh9mZtx0ss/uwTpv57aUYeRvrF8gBeGgS # akb8ySdGHYwLlrmBGnHrAu0dzqspNIBIOFunnJwLdcTbOCrAsApdCsmucWAaK6XG # qyYFr0u6sizWx5LMZIjMztqNfhm4GGcQYrg28w7Cru4Zoj1NZHsj3M5PTDUBBG3/ # ZD3zZVqehFTu5QD3aldAIEZK/VbOSBwyvLycDcaMf4dErrb2QY/1E06gcjki7Mvt # IGT5gIa//7u8lV+hPGjUj8DpIAWrYizSzWT8Zxt7KdR9xGG1KBlM9mKoaj3+KfHQ # AGtZYtzfpVfdtVAP0RTghnnLfaX4dJJ2yZQwgdnINxXivtdph9rN3vSe1ljrXwFD # RJglQhVmdpGhKZ6lPsmKmwrlVp0UBS8hss4Fvy9kugQ3iR8NvLYRr5c8lCkvOyFC # lHd/LBE/0oBdqOntPjsGltRqtltaA7HF0CRdbkog5vTBWl0ks03r4c+vTU9CZddq # l8SWBXWhQ6UbuaC/QOI88uNuNveO3yfC3unF+Y9Pm4s+THRghEjeDW76A+x+3i0v # fEZ4JAneXHLCMlAovN70U6MibCBinvQa+lIdfPrTS1miOHalgx4zbve66hS4SIZ7 # IV44gm4kaMgznW2d8A+6lheq6zUYnok4ZF8LRI4iwWijuyQtz6/En3rvQLkEIIgP # p38= # SIG # End signature block |