Skip to content

Commit 4f447e8

Browse files
authored
Merge pull request KelvinTegelaar#1697 from kris6673/issue4878
Fix: Filter out excluded licenses in Sync-CippExtensionData function
2 parents 68c8228 + 80d4a41 commit 4f447e8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Modules/CippExtensions/Public/Extension Functions/Sync-CippExtensionData.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ function Sync-CippExtensionData {
228228
$Data = $Data.Value
229229
}
230230

231+
# Filter out excluded licenses to respect the ExcludedLicenses table
232+
if ($_.id -eq 'Licenses') {
233+
$LicenseTable = Get-CIPPTable -TableName ExcludedLicenses
234+
$ExcludedSkuList = Get-CIPPAzDataTableEntity @LicenseTable
235+
if ($ExcludedSkuList) {
236+
$Data = $Data | Where-Object { $_.skuId -notin $ExcludedSkuList.GUID }
237+
}
238+
}
239+
231240
$Entity = @{
232241
PartitionKey = $TenantFilter
233242
RowKey = $_.id

Tools/Initialize-DevEnvironment.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ if ((Test-Path $PowerShellWorkerRoot) -and !('Microsoft.Azure.Functions.PowerShe
1515
Add-Type -Path $PowerShellWorkerRoot
1616
}
1717

18+
# Remove previously loaded modules to force reloading if new code changes were made
19+
$LoadedModules = Get-Module | Select-Object -ExpandProperty Name
20+
switch ($LoadedModules) {
21+
'CIPPCore' { Remove-Module CIPPCore -Force }
22+
'CippExtensions' { Remove-Module CippExtensions -Force }
23+
'MicrosoftTeams' { Remove-Module MicrosoftTeams -Force }
24+
}
25+
1826
Import-Module ( Join-Path $CippRoot 'Modules\AzBobbyTables' )
1927
Import-Module ( Join-Path $CippRoot 'Modules\DNSHealth' )
2028
Import-Module ( Join-Path $CippRoot 'Modules\CIPPCore' )

0 commit comments

Comments
 (0)