Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test-DSCResource failing with call depth overflow #5762

Open
dannyKBjj opened this issue Feb 12, 2025 · 7 comments
Open

Test-DSCResource failing with call depth overflow #5762

dannyKBjj opened this issue Feb 12, 2025 · 7 comments

Comments

@dannyKBjj
Copy link
Contributor

dannyKBjj commented Feb 12, 2025

Description of the issue

Hi,
Creating a custom dsc resource for iOS catalogue settings. This is resulting in some pretty deep nested structures - more complex than any other resource I've done. My dsc export compiles fine. I have 2 policies in it. When I run Test-DSCresource

The script failed due to call depth overflow.
+ CategoryInfo : InvalidOperation: (0:) [], CimException
+ FullyQualifiedErrorId : CallDepthOverflow
+ PSComputerName : localhost

But here is the strange thing - If I edit the M365TenantConfig.ps1 and recompile with either one, or the other of the 2 policies it seems to work just fine...

Perhaps I'm swimming out of my depth but but to my mind if one or the other policy is OK, that implies that the code in the resource is OK? I suspect I'm running into some sort of DSC limitation ?

I've attached my work in progress resource module and ps1 export. Hopefully I'm not doing something stupid (or hopefully I am!) Either way, if someone could advise that'd be much appreciated.

The configurations (x2 working, combined, not working) :
TestConfigs.zip

The DSCResource I'm working on:
TestModule.zip

Microsoft 365 DSC Version

1.25.205.1

Which workloads are affected

Intune

The DSC configuration

# Generated with Microsoft365DSC version 1.25.205.1
# For additional information on how to use Microsoft365DSC, please visit https://aka.ms/M365DSC
param (
)

Configuration M365TenantConfig
{
    param (
    )

    $OrganizationName = $ConfigurationData.NonNodeData.OrganizationName

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.25.205.1'

    Node localhost
    {
        IntuneSettingsCatalogueConfigurationPolicyIOS "IntuneSettingsCatalogueConfigurationPolicyIOS-iOS-Corp(Restrictions)"
        {
            ApplicationId         = $ConfigurationData.NonNodeData.ApplicationId;
            Assignments           = @(
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    groupDisplayName = 'Intune Admins'
                    dataType = '#microsoft.graph.exclusionGroupAssignmentTarget'
                    groupId = '81eda236-f640-4b4e-9dbd-5ceabd40dcd2'
                }
                MSFT_DeviceManagementConfigurationPolicyAssignments{
                    deviceAndAppManagementAssignmentFilterType = 'none'
                    groupDisplayName = 'GRP_Intune_App_MSEdge'
                    dataType = '#microsoft.graph.groupAssignmentTarget'
                    groupId = 'b69f3898-96e7-4473-a282-35fcb6f3d1ce'
                }
            );
            CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
            Description           = "To configure the restrictions payload to enable or disable features on devices. These configurations can be used to prevent users from accessing a specific app, service, or function on enrolled devices. For example, a restriction can be added that prevents an iPhone or iPad from using AirPrint. Another restriction can be added to prevent the sharing of passwords over AirDrop on an iPhone, iPad, and Mac. Certain restrictions on an iPhone may be mirrored on a paired Apple Watch.";
            Ensure                = "Present";
            Id                    = "751a2c0a-3e83-4728-abd1-bbb507e23f82";
            Name                  = "iOS-Corp(Restrictions)";
            Platforms             = "iOS";
            RoleScopeTagIds       = @("0");
            Settings              = @(
                MSFT_DeviceManagementSettingInstance{
                    dataType = '#microsoft.graph.deviceManagementConfigurationSetting'
                    settingInstance = MSFT_DeviceManagementConfigurationSetting{
                        settingDefinitionId = 'com.apple.applicationaccess_com.apple.applicationaccess'
                        dataType = '#microsoft.graph.deviceManagementConfigurationGroupSettingCollectionInstance'
                        groupSettingCollectionValue = @(
                            MSFT_DeviceManagementConfigurationGroupSettingCollectionInstance{
                                children = @(
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowimageplayground_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowimageplayground'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowimagewand_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowimagewand'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowiphonemirroring_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowiphonemirroring'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowlivevoicemail_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowlivevoicemail'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowpersonalizedhandwritingresults_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowpersonalizedhandwritingresults'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowrapidsecurityresponseremoval_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowrapidsecurityresponseremoval'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowrcsmessaging_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowrcsmessaging'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowvideoconferencingremotecontrol_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowvideoconferencingremotecontrol'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowwritingtools_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowwritingtools'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                )

                            }
                        )

                    }

                }
            );
            Technologies          = "mdm,appleRemoteManagement";
            TenantId              = $OrganizationName;
        }
        IntuneSettingsCatalogueConfigurationPolicyIOS "IntuneSettingsCatalogueConfigurationPolicyIOS-iOS-Corp(Restrictions) - test"
        {
            ApplicationId         = $ConfigurationData.NonNodeData.ApplicationId;
            Assignments           = @();
            CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
            Description           = "Testing";
            Ensure                = "Present";
            Id                    = "f36edb02-e609-4d55-9f51-65ca72f96ef3";
            Name                  = "iOS-Corp(Restrictions) - test";
            Platforms             = "iOS";
            RoleScopeTagIds       = @("0");
            Settings              = @(
                MSFT_DeviceManagementSettingInstance{
                    dataType = '#microsoft.graph.deviceManagementConfigurationSetting'
                    settingInstance = MSFT_DeviceManagementConfigurationSetting{
                        settingDefinitionId = @(
                            'com.apple.applicationaccess_com.apple.applicationaccess'
                            'com.apple.webcontent-filter_com.apple.webcontent-filter'
                        )
                        dataType = '#microsoft.graph.deviceManagementConfigurationGroupSettingCollectionInstance'
                        groupSettingCollectionValue = @(
                            MSFT_DeviceManagementConfigurationGroupSettingCollectionInstance{
                                children = @(
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowimageplayground_true'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowimageplayground'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowimagewand_true'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowimagewand'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowiphonemirroring_true'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowiphonemirroring'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowpersonalizedhandwritingresults_true'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowpersonalizedhandwritingresults'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowrapidsecurityresponseinstallation_true'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowrapidsecurityresponseinstallation'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.applicationaccess_allowrapidsecurityresponseremoval_false'

                                        }
                                        settingDefinitionId = 'com.apple.applicationaccess_allowrapidsecurityresponseremoval'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        settingDefinitionId = 'com.apple.webcontent-filter_allowlistbookmarks'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationGroupSettingCollectionInstance'
                                        groupSettingCollectionValue = @(
                                            MSFT_DeviceManagementConfigurationGroupSettingCollectionInstance{
                                                children = @(
                                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                                        settingDefinitionId = 'com.apple.webcontent-filter_allowlistbookmarks_item_title'
                                                        simpleSettingValue = MSFT_DeviceManagementConfigurationSimpleSettingValue{
                                                            dataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                                            value = 'test'
                                                        }
                                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                                    }
                                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                                        settingDefinitionId = 'com.apple.webcontent-filter_allowlistbookmarks_item_url'
                                                        simpleSettingValue = MSFT_DeviceManagementConfigurationSimpleSettingValue{
                                                            dataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                                            value = 'www.blocked.com'
                                                        }
                                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                                    }
                                                )

                                            }
                                        )

                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.webcontent-filter_autofilterenabled_true'

                                        }
                                        settingDefinitionId = 'com.apple.webcontent-filter_autofilterenabled'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        settingDefinitionId = 'com.apple.webcontent-filter_denylisturls'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingCollectionInstance'
                                        simpleSettingCollectionValue = @(
                                            MSFT_DeviceManagementConfigurationSimpleSettingCollectionValue{
                                                dataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                                value = 'www.bbc.co.uk'
                                            }
                                        )

                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.webcontent-filter_filterbrowsers_true'

                                        }
                                        settingDefinitionId = 'com.apple.webcontent-filter_filterbrowsers'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.webcontent-filter_filtersockets_true'

                                        }
                                        settingDefinitionId = 'com.apple.webcontent-filter_filtersockets'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.webcontent-filter_filtertype_0'

                                        }
                                        settingDefinitionId = 'com.apple.webcontent-filter_filtertype'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        choiceSettingValue = MSFT_DeviceManagementConfigurationChoiceSettingValue{
                                            value = 'com.apple.webcontent-filter_hidedenylisturls_true'

                                        }
                                        settingDefinitionId = 'com.apple.webcontent-filter_hidedenylisturls'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationChoiceSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        settingDefinitionId = 'com.apple.webcontent-filter_organization'
                                        simpleSettingValue = MSFT_DeviceManagementConfigurationSimpleSettingValue{
                                            dataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                            value = 'DannyKbjj'
                                        }
                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        settingDefinitionId = 'com.apple.webcontent-filter_password'
                                        simpleSettingValue = MSFT_DeviceManagementConfigurationSimpleSettingValue{
                                            dataType = '#microsoft.graph.deviceManagementConfigurationSecretSettingValue'
                                            value = '6e1abf14-c489-448e-be82-8c6816e144e0'
                                            valueState = 'encryptedValueToken'
                                        }
                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        settingDefinitionId = 'com.apple.webcontent-filter_permittedurls'
                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingCollectionInstance'
                                        simpleSettingCollectionValue = @(
                                            MSFT_DeviceManagementConfigurationSimpleSettingCollectionValue{
                                                dataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                                value = 'www.google.com'
                                            }
                                        )

                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        settingDefinitionId = 'com.apple.webcontent-filter_pluginbundleid'
                                        simpleSettingValue = MSFT_DeviceManagementConfigurationSimpleSettingValue{
                                            dataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                            value = 'app:id'
                                        }
                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        settingDefinitionId = 'com.apple.webcontent-filter_serveraddress'
                                        simpleSettingValue = MSFT_DeviceManagementConfigurationSimpleSettingValue{
                                            dataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                            value = '10.1.0.1'
                                        }
                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        settingDefinitionId = 'com.apple.webcontent-filter_userdefinedname'
                                        simpleSettingValue = MSFT_DeviceManagementConfigurationSimpleSettingValue{
                                            dataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                            value = 'daniel'
                                        }
                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                    }
                                    MSFT_DeviceManagementConfigurationChoiceSettingInstance{
                                        settingDefinitionId = 'com.apple.webcontent-filter_username'
                                        simpleSettingValue = MSFT_DeviceManagementConfigurationSimpleSettingValue{
                                            dataType = '#microsoft.graph.deviceManagementConfigurationStringSettingValue'
                                            value = 'daniel'
                                        }
                                        dataType = '#microsoft.graph.deviceManagementConfigurationSimpleSettingInstance'
                                    }
                                )

                            }
                        )

                    }

                }
            );
            Technologies          = "mdm,appleRemoteManagement";
            TenantId              = $OrganizationName;
        }
    }
}

M365TenantConfig -ConfigurationData .\ConfigurationData.psd1

Verbose logs showing the problem

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The PowerShell DSC resource
'[IntuneSettingsCatalogueConfigurationPolicyIOS]IntuneSettingsCatalogueConfigurationPolicyIOS-iOS-Corp(Restrictions) -
test' with SourceInfo 'C:\dsc-IntuneSettingsCatalogueConfigurationPolicyIOS\M365TenantConfig.ps1::134::9::IntuneSetting
sCatalogueConfigurationPolicyIOS' threw one or more non-terminating errors while running the Test-TargetResource
functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this
channel for more details.
    + CategoryInfo          : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost

PS C:\dsc-IntuneSettingsCatalogueConfigurationPolicyIOS> $MaximumFunctionCount = 20000
PS C:\dsc-IntuneSettingsCatalogueConfigurationPolicyIOS> $MaximumFunctionCount
20000
PS C:\dsc-IntuneSettingsCatalogueConfigurationPolicyIOS> Test-DscConfiguration .\M365TenantConfig
The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The script failed due to call depth overflow.
    + CategoryInfo          : InvalidOperation: (0:) [], CimException
    + FullyQualifiedErrorId : CallDepthOverflow
    + PSComputerName        : localhost

The PowerShell DSC resource
'[IntuneSettingsCatalogueConfigurationPolicyIOS]IntuneSettingsCatalogueConfigurationPolicyIOS-iOS-Corp(Restrictions) -
test' with SourceInfo 'C:\dsc-IntuneSettingsCatalogueConfigurationPolicyIOS\M365TenantConfig.ps1::134::9::IntuneSetting
sCatalogueConfigurationPolicyIOS' threw one or more non-terminating errors while running the Test-TargetResource
functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this
channel for more details.
    + CategoryInfo          : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost

Environment Information + PowerShell Version

@ricmestre
Copy link
Contributor

At that point why not just use the regular Settings Catalog? There's no point in having another one almost the same, and uber complex as Settings Catalog already is, unless you made one that under the hood was a Settings Catalog policy but you used simpler properties and values for it like a few policies that we have today and where this is done.

@dannyKBjj
Copy link
Contributor Author

It's for a policy our client wants to export, to be fair I have it working for what they need, but I assumed to get the module accepted it'd have to support all the setting? I can certainly reduce the scope if that's acceptable?

@dannyKBjj
Copy link
Contributor Author

Although re-reading that I'm not fully sure I get what you mean? I started on the module as the policies I wanted weren't exporting/supported by existing modules, but yeah, it has opened a bit of a can of worms it seems...

@FabienTschanz
Copy link
Collaborator

FabienTschanz commented Feb 12, 2025

@ricmestre I don't think there is a resource that contains the regular Settings Catalog capability. All the other resources are based on templates from the Settings Catalog, so they have their properties available by definition in the template. That's not the case for the regular policies, they are fetched dynamically by a way I wasn't able to reproduce unfortunately.

@dannyKBjj Attached is my version a little bit updated to match the latest changes from Microsoft365DSC. I didn't find any issues whatsoever during Test-DscResource. What I'm also wondering: How is somebody even supposed to configure such a resource if they aren't going to look into the depths of the Settings Catalog? Probably never, I assume. We probably have to solve this differently.

MSFT_IntuneSettingsCatalogueConfigurationPolicyIOS.zip

@ricmestre
Copy link
Contributor

I made the question not to detract the inclusion of this resource, the reason I asked is because my customers expect to have support teams using markdown files to deploy changes (not blueprints) and I was never able to make the current Settings Catalog policy to work, and kinda gave up on it already to be honest, so I just dump the Settings property from the blueprint as-is into the markdown file and then it's business as usual like modifying a blueprint which even I cannot make anything of it because I don't know what those properties and values are or do. There's this project on GH [0] which has some spreadsheets which might help a bit but also doesn't tell you what the properties do but the files there are not updated regularly anyway so...

Then seeing yet another monstrosity added to the project gives me yet more nightmares!!! @dannyKBjj This is not your problem, I'm just baffled at how the Intune team were able to create something with potentially infinite nested levels of properties, it may work in the backend but no one will actually use this in a configuration-as-code scenario, except for maybe exports but definitely not deployments.

[0] https://github.com/IntunePMFiles/DeviceConfig

@dannyKBjj
Copy link
Contributor Author

dannyKBjj commented Feb 13, 2025

Yeah, indeed, although it kind of is my problem, because the client wants to M365DSC to support it for iOS.

I've defined a recursive object structure in my mof and from my testing so far it seems capable of correctly exporting, testing and setting. I can't say I've been through all 15 areas yet, but so far the structure seems good. The catch seems to be that if I have more than one policy defined in the M365TenantConfig.ps1 I run into the 'call depth overflow'. I'm unsure why that's an issue, as it should be testing each policy individually anyway?

@FabienTschanz I tried the edited files you attached, but they fail to export the configurations from my tenant and won't work with my existing localhost.mof as you've removed 2 of the properties (Technologies and Platforms) ? I'd assumed they were essential parts of the JSON structure for the policy, but perhaps not? I'll diff the files later to what else you've changed.

@FabienTschanz
Copy link
Collaborator

@dannyKBjj I removed them because for this specific case with iOS, the platform and technologies are always the same.

@ricmestre I was working on a Settings Catalog Whitepaper, but I never got the required assistance to understand how the settings are fetched behind the scenes for policies without a template. Therefore I don't have a working solution for this 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants