Closed PrzemyslawKlys closed 2 years ago
The reason for this is the AST is different. Would require updating logic if at all possible, because there's a lot of differences
Probably better to detect this situation and write warning.
Within Microsoft365DSC there is logic to remove the required version entirely. This impacts the process if there are several versions of a module present. https://github.com/microsoft/Microsoft365DSC/blob/Dev/Modules/Microsoft365DSC/Modules/M365DSCReport.psm1#L33-L43
I really like the idea to show an information/warning about a miss match of versions.
I think removing is one thing, but there should be logic to maybe not setting it up first.
I totally agree with you. Removing this part is just going around the problem - and this also cause some additional issues: see https://github.com/microsoft/Microsoft365DSC/issues/1725#issuecomment-1047227465
If you try to process DSC file while the Import-DSCResource references module that doesn't exists (in my case I had newer version) it would not deliver proper object
Object returned: