Skip to content
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

Issues due to multiple versions of M365DSC in regards to reporting - Test-M365ModuleValidity should be called #2074

Closed
andikrueger opened this issue Jul 7, 2022 · 8 comments · Fixed by #2142
Labels
Bug Something isn't working Core Engine Enhancement New feature or request

Comments

@andikrueger
Copy link
Collaborator

At the moment there are various issues that are caused by the presence of multiple versions of M365 DSC on the local system. These issues can be resolved by uninstalling the versions not needed.

The following command resolves most of the issues:

Update-Module Microsoft365DSC
Update-M365DSCDependencies
Uninstall-M365DSCOutdatedDependencies

I would suggest to introduce a new method Test-M365DSCUpdateStatus to verify if, there are updates available and/or multiple versions present on the local system. This function should be called within the repot and documentation functions and show warnings, if there issues detected.

@andikrueger andikrueger added Bug Something isn't working Core Engine Enhancement New feature or request labels Jul 7, 2022
@fldried
Copy link
Contributor

fldried commented Jul 20, 2022

so what you're suggesting is a method that just checks for multiple installations of the m365dsc module, checks if theres multiple versions installed (e.g by running

if ($null -ne (Get-Module -Name Microsoft365DSC -List)[1]) { <# uninstall outdated versions by comparing to psgallery version #> }

and the integrated method Test-M365DSCDependencies?

@andikrueger
Copy link
Collaborator Author

I would go with a function like this (sorry, I’m writing this on my mobile; PseudoCode)

$psgalleryversion = Find-module Microsoft365DSC
$localversion = Get-Module Microsoft365DSC

if($psgallery.Version -gt $localversion.Version)
Write-Host “there is a newer version of M365DSC. please run the three commands above”)

@fldried
Copy link
Contributor

fldried commented Jul 20, 2022

I'll go with your approach, changing my pr in a bit. appreciate the input :)

@fldried
Copy link
Contributor

fldried commented Jul 20, 2022

I've just pushed an update to my PR
The Uninstall-M365DSCOutdatedDependencies cmdlet still doesn't check for multiple installations of the latest version,
but it does for the Microsoft365DSC module now :)
I hope this is closer to what you imagined the extra cmdlet to do

@andikrueger
Copy link
Collaborator Author

Thanks. This is Beth close to what I had in mind.

It would be great to include this function in reporting and export cmdLets. This would solve many issues due to outdated modules.
I would go without prompting the user for input in both scenarios as this might break pipelines or automation.

@fldried
Copy link
Contributor

fldried commented Jul 20, 2022

updated again :D

@andikrueger
Copy link
Collaborator Author

Actually I think there is one thing missing. The new function is not called from the reporting mechanism, isn’t it?

@andikrueger andikrueger reopened this Jul 26, 2022
@andikrueger
Copy link
Collaborator Author

Reopening this issue, as there is one part missing:

All Reporting functions within M365 should call Test-M365ModuleValidity and display a warning message.

@andikrueger andikrueger changed the title Issues due to multiple versions of Microsoft 365 DSC in regards to reporting Issues due to multiple versions of M365DSC in regards to reporting - Test-M365ModuleValidity should be called Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Core Engine Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants