Skip to content

Commit

Permalink
Add policy set definition workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredfholgate committed Jun 5, 2024
1 parent befa244 commit 7e2e3a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Alz.Tools/functions/Alz.Tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ function ProcessObjectByResourceType {
}
"microsoft.authorization/policysetdefinitions" {
$outputObject = [PolicySetDefinition]::new($ResourceObject)
# Workaround for policySetDefinitions that only have a single policyDefinition. PowerShell tires to convert to an object in that scenario.
if($outputObject.properties.policyDefinitions.GetType().ToString() -eq "PolicySetDefinitionPropertiesPolicyDefinitions") {
$outputObject.properties.policyDefinitions = @($outputObject.properties.policyDefinitions)
}
}
"microsoft.authorization/roleassignments" {
$outputObject = [RoleAssignment]::new($ResourceObject)
Expand Down

0 comments on commit 7e2e3a8

Please sign in to comment.