Søren Albeck
Søren Albeck
Adding or removing members are not part of unit-tests for the resource, so it might as well never have worked. That or it's a 'feature' of Graph in v. 1.11.0
The issue occurs using 1.,22.727.1 (ie Microsoft.Graph.* 1.11.0)
I can confirm that Graph v1.11.1 works with New-MgGroupOwner and New-MgGroupMember
I havent't been through each resource in detail but I noticed that the IntuneDeviceConfigurationPolicyMacOS includes assignments (despite the export-error it's quite cool). I discovered the missing assignments (and the error)...
Changing the Get-ChildItem filter to "MSFT_Intune**Policy**.mof" removes 3 false positives. These remain: IntuneAppConfigurationPolicy IntuneApplicationControlPolicyWindows10 IntuneASRRulesPolicyWindows10 IntuneDeviceCompliancePolicyAndroid IntuneDeviceCompliancePolicyAndroidDeviceOwner IntuneDeviceCompliancePolicyAndroidWorkProfile IntuneDeviceCompliancePolicyiOs IntuneDeviceCompliancePolicyMacOS IntuneDeviceConfigurationPolicyAndroidWorkProfile IntuneDeviceConfigurationPolicyiOS IntuneDeviceConfigurationPolicyWindows10 IntuneDeviceUpdateConfigurationPolicyiOS IntuneSettingCatalogASRRulesPolicyWindows10
I think I have the unit-tests sorted by using -ParameterFilter in the Get-MgGroup mocks. Tests include whether a group is a member of another group and whether a group is...
Unit-testing is now under wraps. It isn't pretty but the power of Pester really shows.
PR #2316 created
You already have the option to use default values in each session, see https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parameters_default_values?view=powershell-7.3 It can easily get a bit hairy though so a single function to manage Graph-specific default...