diff --git a/src/Alz.Tools/functions/Alz.Tools.ps1 b/src/Alz.Tools/functions/Alz.Tools.ps1 index e2b3a6c514..d45212513b 100644 --- a/src/Alz.Tools/functions/Alz.Tools.ps1 +++ b/src/Alz.Tools/functions/Alz.Tools.ps1 @@ -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)