|Getting Chocolatey Package Management Provider Working on Windows 10|
|Written by Darwin Sanoy|
|Sunday, February 28, 2016 1:00am|
Have you had some frustrating experiences trying to use the new Chocolatey Package Management provider on Windows 10? Me too! But I have some tips to help you get it working as well as possible.
Before you get started - if you have installed the RTM version of WMF 5 / PSH 5 on a fresh machine (Feb 24, 2016 re-release) or you have a February patched version of Windows 10, you will not have any of the below problems. One exception - If you previously worked with the chocolatey provider on a windows instance using the WMF 5 pre-releases (or Windows 10 before Feb updates) - you may still have the problem of not having the 188.8.131.52 version of the Chocolatey provider even after applying the RTM version of WMF 5 - and as far as I know, the Chocolatey provider does not auto-update.
In my testing it also appears like it is not a good idea to install and actively use both the regular Chocolate Client and the WMF 5 Chocolatey provider. It could be some facet of my configuration, but I have experienced it on multiple OS versions on clean VMs. The Chocolatey dev team appears to be working to make both modes use the same code base - but that is a while off.
When doing some initial playing with the WMF 5 Chocolatey provider I was getting these weird behaviors:
If you have Windows 10 on real hardware and it has been running for some weeks before you try to use the Chocolatey provider for Windows Package Management - then you will read this and say "I didn't have these problems!" The same is true of loading the PowerShell 5 Production Preview or later on other OSes. These problems are resolved when Windows 10 Update updates PowerShell and the PackageManagement provider.
So why write? If you're like me you might have a library of trial VMs for testing. You may also typically take pains to disable Windows Updates or the fact that you regularly restart from an unpatched baseline resets your patch level to RTM. So if you are doing a feasibility study on WMF 5 / PSH 5 Package Management from a VM library you could come to the conclusion that it is more broken than it really is.
You should understand that even after you use the below steps to resolve the issues, that the Chocolatey Package Management provider was turned over to the open source community and hasn't been in active development until relatively recently. So if you are already into Chocolatey big time - you will notice things are a little rough and bare metalish in the current provider - but the Chocolatey dev team is now working with the provider and will be making sure that it eventually shares the code base of the Chocolatey client.
If you boot up a fresh RTM copy of Windows 10 and open PowerShell you will likely find the following runtime levels:
> Get-Module PackageManagement -ListAvailable | Select Name, Version, ModuleBase
> Get-Command -Module PackageManagement
> Get-PackageProvider Chocolatey | select Name, Version, ProviderPath | fl
So to make sure you have the best possible experience you would need to:
1. Run Windows Update (to get the lastest PowerShell and PackageManagement)
At a minimum you should have not problems with the list at the start of this article.