-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New-M365DSCDeltaReport returns no delta information #1970
Comments
I am also getting similar issues. These are the errors im getting
I want to compare a dev environment after making changes, and also against a blueprint thats created. |
These errors are related to configurations that do not hold proper information about the Microsoft365DSC Version used for the export/configuration. Please make sure to have the following line with -ModuleVersion within your configuration/blueprint Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.22.202.1' $OutputPath is a mandatory parameter. Currently the parameter misses this appropriate annotation. |
Hi Andi, I don't fully agree with your statement of the 'ModuleVersion' being required, because in all the functions in M365DSC that use ConvertTo-DSCObject these are stripped from the file content before parsing the DSC file (effectively breaking ConvertTo-DSCObject in PS7) To illustrate what I mean, please see these lines
This modification of the DSC content breaks parsing the DSC object in PowerShell 7. To summarize, here are the results of my tests: ConvertTo-DSCObject, file content WITH ModuleVersion ConvertTo-DSCObject, file content WITHOUT ModuleVersion So, in general I think it's better to NOT strip the ModuleVersion from the FileContent so it will work in all PS versions... @NikCharlebois I see you've added these modifications in 87bf79f |
That change was made to allow the conversion of configurations regardless of microsoft365dsc module version available on the system. could you verify that you do not have multiple versions of m365dsc installed within ps7? Please have a look at the comments within #2120. |
Andi is correct, the ModuleVersion was removed to ensure you could compare two configurations that were using a different version of the module. Otherwise, you would have to manually update the configuration to point to the correct installed version every time an assessment was being performed. I am working on a fix that will ensure the ModuleVersion is found before attempting to strip it out. I was able to confirm that this works with both PoSh 5 and 7.1 if the module version is not specified in the files. |
Oops, my bad. Removing the old Microsoft365DSC versions in PS7 fixed it for me. I assumed this had to do with the difference in PowerShell versions, but just now I learned that only one version of the Microsoft365DSC module needs to be installed... Thanks for having a look @andikrueger and @NikCharlebois! |
Details of the scenario you tried and the problem that is occurring
Comparing the files output by Export-M365DSCConfiguration for two different SPO tenant level settings (CommentsOnSitePagesDisabled, SPOHubSite, LegacyAuthProtocolsEnabled, etc), the New-M365DSCDeltaReport command does not output any difference information.
New-M365DSCDeltaReport -Source "C:\temp\dsc\20220526Config.ps1" -Destination "C:\temp\dsc\InitialConfig.ps1" -OutputPath "C:\temp\dsc\output.html"
Verbose logs showing the problem
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# insert configuration here
The operating system the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
1.22.525.1
The text was updated successfully, but these errors were encountered: