Created
March 18, 2021 07:37
-
-
Save StefanIvemo/bf07276dd2c4ccef719f4af40b9847e0 to your computer and use it in GitHub Desktop.
Get-PoliciesWithDINEEffectParam.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$allPolicies = Get-AzPolicyDefinition | |
$policies = [System.Collections.ArrayList]::new() | |
foreach ($policy in $allPolicies) { | |
if ('DeployIfNotExists' -in $policy.Properties.Parameters.effect.allowedValues) { | |
$policyInfo = [PSCustomObject]@{ | |
Name = $policy.Name | |
DisplayName = $policy.Properties.DisplayName | |
PolicyDefinitionId = $policy.PolicyDefinitionId | |
} | |
$null = $policies.Add($policyInfo) | |
} | |
} | |
$policies |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment