Skip to content

Commit

Permalink
Merge pull request #2642 from NikCharlebois/FIXES-#2597
Browse files Browse the repository at this point in the history
Fixes #2597
  • Loading branch information
NikCharlebois authored Dec 8, 2022
2 parents 572b2d3 + dc20b86 commit b00c668
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# UNRELEASED

* AADGroup
* Fixes an issue where licenses aren't properly assigned when no existing licenses exist.
FIXES [#2597](https://github.com/microsoft/Microsoft365DSC/issues/2597)
* AADServicePrincipal
* Fixes an issue where the service principals weren't created or updated when using ApplicationSecret to authenticate.
FIXES [#2615](https://github.com/microsoft/Microsoft365DSC/issues/2615)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ function Get-M365DSCCombinedLicenses
{
foreach ($license in $DesiredLicenses)
{
if (-not $result.SkuId.Contains($license.SkuId))
if ($result.Length -eq 0)
{
$result += @{
SkuId = $license.SkuId
Expand All @@ -1187,12 +1187,22 @@ function Get-M365DSCCombinedLicenses
}
else
{
#Set the Desired Disabled Plans if the sku is already added to the list
foreach ($item in $result)
if (-not $result.SkuId.Contains($license.SkuId))
{
if ($item.SkuId -eq $license.SkuId)
$result += @{
SkuId = $license.SkuId
DisabledPlans = $license.DisabledPlans
}
}
else
{
#Set the Desired Disabled Plans if the sku is already added to the list
foreach ($item in $result)
{
$item.DisabledPlans = $license.DisabledPlans
if ($item.SkuId -eq $license.SkuId)
{
$item.DisabledPlans = $license.DisabledPlans
}
}
}
}
Expand Down

0 comments on commit b00c668

Please sign in to comment.