I’m confused about what I’m supposed to do with built in PackageManagement module which comes preinstalled with Windows 2016. I can not update it directly since it was not installed from Gallery and when I install newer version from Gallery I end up with 2 modules and 2 names for all DSC Resources. How do I uninstall built in module or what is best practice here?
Yeah, unfortunately due to the way protected system files exist, they can’t be updated that way (although you can try using -Force). The most you can do is try to delete them, although in many cases the system will attempt to “repair” itself and put them back. It’s something I don’t think they thought through really well.
You can target a version using -RequiredVersion parameter for Import-module cmdlet. There are more ways to control version for this cmdlet. I suggest you to take a look at the help documentation of Import-Module cdmlet.
I need to load latest version of module. Notation inside Import-DSCresource requires exact module version. Script I’m working on will be used on computers for quite sometime and I want always the latest version of PackageManagement resources to be used. I assume there is no solution to this?