You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you tried and the problem that is occurring
While testing filtering during exporting it was working fine with the one I chose, then I assigned that filter (hashtable) to a local variable called $Filter, afterwards running the same export it failed even if without using the $Filter variable in the arguments.
[...]
Connecting to {MicrosoftGraph}...✅
[1/1] Extracting [AADUser] using {Credentials}...Partial Export file was saved at: C:\Users\ADM_PT~1\AppData\Local\Temp\bd7321ad-b82f-4330-bc65-f359abd99c3b.partial.ps1
Exception calling "Add" with "2" argument(s): "Item has already been added. Key in dictionary: 'Filter' Key being added: 'Filter'"
At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.719.1\modules\M365DSCReverse.psm1:612 char:25+$parameters.Add('Filter',$resourceFilter)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException
Suggested solution to the issue
This is because the code in M365DSCReverse.psm1 is wrong since it's looking at $Filter variable instead of $Filters in one chunk ($Filter at this point is always $null unless you define it locally), adds Filter to $parameters and then tries to add it again at line 612, if $Filter was defined locally then it fails at that line. In order to fix this the first chunk should be removed and adapt second one.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Details of the scenario you tried and the problem that is occurring
While testing filtering during exporting it was working fine with the one I chose, then I assigned that filter (hashtable) to a local variable called $Filter, afterwards running the same export it failed even if without using the $Filter variable in the arguments.
Verbose logs showing the problem
Suggested solution to the issue
This is because the code in M365DSCReverse.psm1 is wrong since it's looking at $Filter variable instead of $Filters in one chunk ($Filter at this point is always $null unless you define it locally), adds Filter to $parameters and then tries to add it again at line 612, if $Filter was defined locally then it fails at that line. In order to fix this the first chunk should be removed and adapt second one.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
N/A
The operating system the target node is running
OsName : Microsoft Windows 10 Enterprise OsOperatingSystemSKU : EnterpriseEdition OsArchitecture : 64-bit WindowsVersion : 2009 WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406 OsLanguage : en-US OsMuiLanguages : {en-US}
Version of the DSC module that was used ('dev' if using current dev branch)
Dev
The text was updated successfully, but these errors were encountered: