Clear-CafPolicyAssets
Deletes all policies defined in the BICEP files under the current path.
Syntax
Clear-CafPolicyAssets
[-DebugLevel <string>]
[-ServicePrincipalType <string>]
[-Force]
[-Recurse]
[-WhatIf]
Description
When executed inside specific policy type folders (Assignments, Definitions, Initiative) it will read the bicep files and delete the policies defined in them. The variable policyName must be defined in the bicep files for this to work. General rule for deleting policies is to delete assignments first, initiatives after and finally definitions.
Example
Clear-CafPolicyAssets
Parameter
-DebugLevel
Defines the verboseness of the debug output.
| Property | Value |
|---|---|
| Type: | string |
| Allowed values: | ["All", "None", "RequestContent", "ResponseContent"] |
| Default value: | "All" |
| Required: | False |
-ServicePrincipalType
Defines the type of service principal that should be used.
| Property | Value |
|---|---|
| Type: | string |
| Allowed values: | ["deploy", "ops"] |
| Default value: | "deploy" |
| Required: | False |
-Force
If this switch is present, the command will not ask for confirmation before deleting the policies.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Default value: | False |
| Required: | False |
-Recurse
If this switch is present, the command will recurse into sub directories and delete policies there as well.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Default value: | False |
| Required: | False |
-WhatIf
If this switch is present, the command will not actually delete anything but only show what would be deleted.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Default value: | False |
| Required: | False |