When Export-M365DSCConfiguration parameters are in "wrong" order, results file becomes empty!
ISSUE TITLE:
Export-M365DSCConfiguration: parameters handling sucks
ISSUE DESCRIPTION (this template):
Please provide information regarding your issue under each header below.
This resulted in an erroneous (=empty) ps1 results file: PS C:> Export-M365DSCConfiguration -Quiet -CertificateThumbprint 12345678 -ApplicationId 1234-12345678 -TenantId mytenant.onmicrosoft.com -Path c:\Temp -FileName test2.ps1 -ComponentsToExtract @('AADConditionalAccessPolicy') : Export took {5 seconds}
But simply swapping parameter order, the ps1 file included all relevant results: PS C:> Export-M365DSCConfiguration -Quiet -CertificateThumbprint 12345678 -ApplicationId 1234-12345678 -TenantId mytenant.onmicrosoft.com -ComponentsToExtract @('AADConditionalAccessPolicy') -Path C:\TEMP -FileName test1.ps1 : Export took {57 seconds}
PLEASE KEEP THE HEADERS.
Details of the scenario you tried and the problem that is occurring
Verbose logs showing the problem
Suggested solution to the issue
Correct the way how silent export parameters are handled.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
Standard branch
The weird thing is that when following the console output, all data gets listed there, like this: [1/3] Extracting [AADConditio |---[1/5] AllApps__Browse... |---[2/5] AllApps__Modern... |---[3/5] AllApps__Legacy... :
but depending on parameters order, resulting ps1 files may be empty
@mikespolk thanks for reporting this issue. The core development team is investigating.
@mikespolk this is not something we have been able to replicate. Can you try it on your end with the latest version of the tool thanks?