< Back

Remove-AzureRmPolicySetDefinition

Tue Jan 29, 2019 10:06 pm

NAME Remove-AzureRmPolicySetDefinition



SYNOPSIS

Removes a policy set definition.





SYNTAX

Remove-AzureRmPolicySetDefinition [-ApiVersion <String>] [-DefaultProfile <IAzureContextContainer>] [-Force] -Id <String> [-Pre] [-Confirm]

[-WhatIf] [<CommonParameters>]



Remove-AzureRmPolicySetDefinition [-ApiVersion <String>] [-DefaultProfile <IAzureContextContainer>] [-Force] -Name <String> [-Pre] [-Confirm]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

The Remove-AzureRmPolicySetDefinition cmdlet removes a policy definition.





PARAMETERS

-ApiVersion <String>

When set, indicates the version of the resource provider API to use. If not specified, the API version is automatically determined as the

latest available.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Do not ask for confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Id <String>

The fully qualified policy set definition Id, including the subscription. e.g.

/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

The policy set definition name.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Pre [<SwitchParameter>]

When set, indicates that the cmdlet should use pre-release API versions when automatically determining which version to use.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String







OUTPUTS

System.Boolean







NOTES









Example 1: Remove policy set definition by resource ID



PS C:\\>$PolicySetDefinition = Get-AzureRmPolicySetDefinition -ResourceId

"/subscriptions/mySub/Microsoft.Authorization/policySetDefinitions/myPSSetDefinition"

PS C:\\>Remove-AzureRmPolicySetDefinition -Id $PolicySetDefinition.ResourceId -Force



The first command gets a policy set definition by using the Get-AzureRmPolicySetDefinition cmdlet. The command stores it in the

$PolicySetDefinition variable.



The second command removes the policy set definition identified by the ResourceId property of $PolicySetDefinition.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... definition