Skip to content

Commit

Permalink
restrict policy scope in export - fix3955
Browse files Browse the repository at this point in the history
  • Loading branch information
William-Francillette committed Nov 29, 2023
1 parent f18abeb commit 1559a96
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1418,11 +1418,12 @@ function Export-TargetResource
try
{
$templateFamily = 'endpointSecurityAntivirus'
$templateReferences = "d948ff9b-99cb-4ee0-8012-1fbc09685377_1", "e3f74c5a-a6de-411d-aef6-eb15628f3a0a_1", "45fea5e9-280d-4da1-9792-fb5736da0ca9_1","804339ad-1553-4478-a742-138fb5807418_1"
[array]$policies = Get-MgBetaDeviceManagementConfigurationPolicy `
-ErrorAction Stop `
-All:$true `
-Filter $Filter
$policies = $policies | Where-Object -FilterScript { $_.TemplateReference.TemplateFamily -eq $templateFamily }
$policies = $policies | Where-Object -FilterScript { $_.TemplateReference.TemplateFamily -eq $templateFamily -and $_.TemplateReference.TemplateId -in $templateReferences }

if ($policies.Length -eq 0)
{
Expand Down

0 comments on commit 1559a96

Please sign in to comment.