Skip to content

Commit

Permalink
Merge branch 'Dev' into feat/prepare-settings-catalog-2
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienTschanz authored Dec 5, 2024
2 parents 3e20acf + fbfbf20 commit 5de20a8
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# UNRELEASED

* IntuneFirewallPolicyWindows10
* Fix export of properties that appear multiple times in subsections.
* M365DSCDRGUtil
* Improve settings catalog handling for nested objects.
* M365DSCResourceGenerator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,19 @@ function Get-TargetResource

# Retrieve policy specific settings
[array]$settings = Get-MgBetaDeviceManagementConfigurationPolicySetting `
-All `
-DeviceManagementConfigurationPolicyId $Id `
-ExpandProperty 'settingDefinitions' `
-ErrorAction Stop
$policyTemplateId = $getValue.TemplateReference.TemplateId
[array]$settingDefinitions = Get-MgBetaDeviceManagementConfigurationPolicyTemplateSettingTemplate `
-DeviceManagementConfigurationPolicyTemplateId $policyTemplateId `
-ExpandProperty 'settingDefinitions' `
-All `
-ErrorAction Stop | Select-Object -ExpandProperty SettingDefinitions

$policySettings = @{}
$policySettings = Export-IntuneSettingCatalogPolicySettings -Settings $settings -ReturnHashtable $policySettings
$policySettings = Export-IntuneSettingCatalogPolicySettings -Settings $settings -ReturnHashtable $policySettings -AllSettingDefinitions $settingDefinitions

$results = @{
#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,150 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
)
}

Mock -CommandName Get-MgBetaDeviceManagementConfigurationPolicyTemplateSettingTemplate -MockWith {
return @(
@{
SettingDefinitions = @(
@{
Id = 'vendor_msft_firewall_mdmstore_global_disablestatefulftp'
Name = 'DisableStatefulFtp'
OffsetUri = '/MdmStore/Global/DisableStatefulFtp'
AdditionalProperties = @{
'@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition'
}
}
)
},
@{
SettingDefinitions = @(
@{
Id = 'vendor_msft_firewall_mdmstore_domainprofile_enablefirewall'
Name = 'EnableFirewall'
OffsetUri = '/MdmStore/DomainProfile/EnableFirewall'
AdditionalProperties = @{
'@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition'
}
},
@{
Id = 'vendor_msft_firewall_mdmstore_domainprofile_logfilepath'
Name = 'LogFilePath'
OffsetUri = '/MdmStore/DomainProfile/LogFilePath'
AdditionalProperties = @{
'@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingDefinition'
dependentOn = @(
@{
dependentOn = 'vendor_msft_firewall_mdmstore_domainprofile_enablefirewall_true'
parentSettingId = 'vendor_msft_firewall_mdmstore_domainprofile_enablefirewall'
}
)
}
},
@{
Id = 'vendor_msft_firewall_mdmstore_publicprofile_enablefirewall'
Name = 'EnableFirewall'
OffsetUri = '/MdmStore/PublicProfile/EnableFirewall'
AdditionalProperties = @{
'@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition'
}
},
@{
Id = 'vendor_msft_firewall_mdmstore_publicprofile_logfilepath'
Name = 'LogFilePath'
OffsetUri = '/MdmStore/PublicProfile/LogFilePath'
AdditionalProperties = @{
'@odata.type' = '#microsoft.graph.deviceManagementConfigurationStringSettingDefinition'
dependentOn = @(
@{
dependentOn = 'vendor_msft_firewall_mdmstore_publicprofile_enablefirewall_true'
parentSettingId = 'vendor_msft_firewall_mdmstore_publicprofile_enablefirewall'
}
)
}
}
)
},
@{
SettingDefinitions = @(
@{
Id = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_domainprofile_enablefirewall'
Name = 'EnableFirewall'
OffsetUri = '/MdmStore/HyperVVMSettings/{0}/DomainProfile/EnableFirewall'
AdditionalProperties = @{
'@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition'
options = @(
# Only option used in the tests is defined here
@{
name = 'Enable Firewall'
itemId = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_domainprofile_enablefirewall_true'
dependentOn = @(
@{
dependentOn = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_target_wsl'
parentSettingId = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_target'
}
)
}
)
}
},
@{
Id = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_publicprofile_enablefirewall'
Name = 'EnableFirewall'
OffsetUri = '/MdmStore/HyperVVMSettings/{0}/PublicProfile/EnableFirewall'
AdditionalProperties = @{
'@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition'
options = @(
# Only option used in the tests is defined here
@{
name = 'Enable Firewall'
itemId = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_publicprofile_enablefirewall_true'
dependentOn = @(
@{
dependentOn = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_target_wsl'
parentSettingId = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_target'
}
)
}
)
}
},
@{
Id = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_target'
Name = 'Target'
OffsetUri = '/MdmStore/HyperVVMSettings/{0}/Target'
AdditionalProperties = @{
'@odata.type' = '#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition'
options = @(
@{
dependentOn = @(
@{
dependentOn = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}'
parentSettingId = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}'
}
)
name = 'WSL'
itemId = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_target_wsl'
}
)
}
},
@{
Id = 'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}'
Name = '{VMCreatorId}'
OffsetUri = '/MdmStore/HyperVVMSettings/{0}'
AdditionalProperties = @{
'@odata.type' = '#microsoft.graph.deviceManagementConfigurationSettingGroupCollectionDefinition'
childIds = @(
'vendor_msft_firewall_mdmstore_hypervvmsettings_{vmcreatorid}_target'
)
maximumCount = 1
minimumCount = 0
}
}
)
}
)
}

Mock -CommandName Update-DeviceConfigurationPolicyAssignment -MockWith {
}

Expand Down

0 comments on commit 5de20a8

Please sign in to comment.