File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
articles/governance/policy/troubleshoot Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -333,12 +333,12 @@ Guest configuration relies on custom metadata added to policy definitions when c
333
333
# ### Resolution
334
334
335
335
Instead of using the portal, duplicate the policy definition using the Policy
336
- Insights API. The following PowerShell sample provides an option .
336
+ Insights API. The following PowerShell sample can copy the policy definition including the metadata using **Az.Resources 7.3.0** or higher .
337
337
338
338
` ` ` powershell
339
339
# duplicates the built-in policy which audits Windows machines for pending reboots
340
- $def = Get-AzPolicyDefinition -id ' /providers/Microsoft.Authorization/policyDefinitions/4221adbc-5c0f-474f-88b7-037a99e6114c' | % Properties
341
- New-AzPolicyDefinition -name (new-guid).guid -DisplayName "$($def.DisplayName) (Copy)" -Description $def.Description -Metadata ($def.Metadata | convertto-json) -Parameter ($def.Parameters | convertto-json) -Policy ($def.PolicyRule | convertto-json -depth 15)
340
+ $def = Get-AzPolicyDefinition -id " /providers/Microsoft.Authorization/policyDefinitions/4221adbc-5c0f-474f-88b7-037a99e6114c"
341
+ New-AzPolicyDefinition -name (new-guid).guid -DisplayName "$($def.DisplayName) (Copy)" -Description $def.Description -Metadata ($def.Metadata | convertto-json) -Parameter ($def.Parameter | convertto-json) -Policy ($def.PolicyRule | convertto-json -depth 15)
342
342
` ` `
343
343
344
344
# ## Scenario: Kubernetes resource gets created during connectivity failure despite deny policy being assigned
You can’t perform that action at this time.
0 commit comments