Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

When Export-M365DSCConfiguration parameters are in "wrong" order, results file becomes empty!

Open mikespolk opened this issue 5 years ago • 3 comments

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

mikespolk avatar Mar 15 '21 07:03 mikespolk

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 avatar Mar 15 '21 08:03 mikespolk

@mikespolk thanks for reporting this issue. The core development team is investigating.

jeff29922 avatar Mar 17 '21 16:03 jeff29922

@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?

NikCharlebois avatar Jul 19 '21 18:07 NikCharlebois