Skip to content

Commit

Permalink
Merge pull request #689 from Azure/688-exception-calling-containskey-…
Browse files Browse the repository at this point in the history
…with-1-arguments-value-cannot-be-null-parameter-key

Bug fix for deprecated Policies
  • Loading branch information
apybar authored Jun 24, 2024
2 parents 732bcd4 + b90c73f commit 9b593e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Scripts/Helpers/Build-AssignmentDefinitionNode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,12 @@ function Build-AssignmentDefinitionNode {
foreach ($parameterName in $addedParameters.Keys) {
$rawParameterValue = $addedParameters.$parameterName
$currentParameterHash = $parameterHash.$parameterName
if ($deprecatedHash.ContainsKey($($currentParameterHash.name)) -and $currentParameterHash.parameters.$parameterName.isEffect) {
$null = $deprecatedInJSON.Add("Assignment: '$($assignment.name)' with Parameter: '$parameterName' ($($currentParameterHash))")
if (!$PacEnvironment.desiredState.doNotDisableDeprecatedPolicies) {
$rawParameterValue = "Disabled"
if ($null -ne $currentParameterHash.name) {
if ($deprecatedHash.ContainsKey($($currentParameterHash.name)) -and $currentParameterHash.parameters.$parameterName.isEffect) {
$null = $deprecatedInJSON.Add("Assignment: '$($assignment.name)' with Parameter: '$parameterName' ($($currentParameterHash))")
if (!$PacEnvironment.desiredState.doNotDisableDeprecatedPolicies) {
$rawParameterValue = "Disabled"
}
}
}
$parameterValue = Get-DeepCloneAsOrderedHashtable $rawParameterValue
Expand Down

0 comments on commit 9b593e7

Please sign in to comment.