Windows 10 (10074) Package Management

By Jogai on Wednesday 6 May 2015 21:00 - Comments (3)
Categories: DevOps, Quick tips, Views: 7.236

To my surprise Windows 10 came with a package manager. I always thought it was the killer feature of Linux distributions. Before I used chocolatey on windows and nuget during my development work, and both are now incorporated in the Windows package manager. If you're thinking I'm talking about OneGet you'd be right, but maybe thats one of the 10 things about OneGet that are completely different than you think. It seems the offcial name of the module that is included in windows is called PackageManagement, so I intent to call it that too. The open source project behind is is still named OneGet.
The blogposts I could find about the setup were a bit different too, so I wanted to share my experience.



Here are the available Cmdlet's of the module:
http://i.imgur.com/oG8ghQFl.png

I think windows has now something like manpages too. Unfortunately this currently fails. "Update-Help PackageManagement" should download help files, but doesn't. I dont know exactly what the cmdlets do, but I guess its the same as described in the OneGet wiki.

If you execute "Get-PackageProvider" you see a list of installed providers.

VBScript:
1
2
3
4
5
6
7
PS C:\Windows\system32> Get-PackageProvider

Name                     Version          DynamicOptions
----                     -------          --------------
msu                      10.0.10074.0     {}
msi                      10.0.10074.0     {AdditionalArguments}
Programs                 10.0.10074.0     {IncludeWindowsInstaller, IncludeSystemComponent}


On a fresh install this contains only the defaults that are used by regular old msi's etc. This is really nice, but I want to use chocolatey. When I tried to install it I got

VBScript:
1
2
WARNING: Unable to find package provider 'PSModule'.
Register-PackageSource : Unable to find package providers (PSModule).



It turns out this was very simple. If you try to get some info on a registered package source it will ask for installation if need be.

VBScript:
1
2
3
4
5
6
7
8
9
10
11
PS C:\Windows\system32> Get-PackageSource -Provider chocolatey

The provider 'chocolatey v2.8.5.101' is not installed.
'chocolatey' may be manually downloaded from 'http://oneget.org/nuget-anycpu-2.8.5.101.exe' and copied to 'C:\Program
Files\PackageManagement\ProviderAssemblies'.
Would you like OneGet to automatically download and install 'chocolatey' now?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

Name                             ProviderName     IsTrusted  IsRegistered IsValidated  Location
----                             ------------     ---------  ------------ -----------  --------
chocolatey                       Chocolatey       False      True         False        http://chocolatey.org/api/v2/



Since chocolatey & nuget are closely related, installing one gives you the other too:

VBScript:
1
2
3
4
5
6
7
8
9
PS C:\Windows\system32> Get-PackageProvider

Name                     Version          DynamicOptions
----                     -------          --------------
msu                      10.0.10074.0     {}
Programs                 10.0.10074.0     {IncludeWindowsInstaller, IncludeSystemComponent}
msi                      10.0.10074.0     {AdditionalArguments}
Chocolatey               2.8.5.101        {SkipDependencies, ContinueOnFailure, ExcludeVersion, ForceX86...}
NuGet                    2.8.5.101        {Destination, SkipDependencies, ContinueOnFailure, ExcludeVersion...}



As you can see now there are 5 packageproviders. Nuget & Chocolatey have sources which are used to find, download & install packages.

Volgende: Flagship killer killer? 07-'15 Flagship killer killer?
Volgende: Mandatory introduction 05-'15 Mandatory introduction

Comments


By Tweakers user Eagle Creek, Thursday 7 May 2015 09:16

Dank! Functie was me nog niet bekend :).

By Tweakers user @r!k, Thursday 7 May 2015 09:50

Is meegekomen met Powershell v5, kun je dus ook op windows 8 beschikbaar krijgen en andere versies van windows die Powershell v5 ondersteunen. :)

By Tweakers user Jogai, Thursday 7 May 2015 10:21

@r!k wrote on Thursday 07 May 2015 @ 09:50:
Is meegekomen met Powershell v5, kun je dus ook op windows 8 beschikbaar krijgen en andere versies van windows die Powershell v5 ondersteunen. :)
Klopt, die preview kun je hier halen: http://blogs.msdn.com/b/p...015-is-now-available.aspx

Comments are closed