This has been present in the Linux world for a very long time, for example with APT-GET (Debian). This new feature is basically a global silent installer for applications and tools. We should also be able to do configuration tasks and anything that you can do with PowerShell. The power you hold with a module like OneGet is only limited by your imagination! :-)

Note that this is a preview, there is no documentation yet, the features and behavior are likely to change before the final release.

OneGet Module ?

OneGet is a new way to discover and install software packages from around the web. With OneGet, you can:

* Manage a list of software repositories in which packages can be searched, acquired, and installed
* Search and filter your repositories to find the packages you need
* Seamlessly install and uninstall packages from one or more repositories with a single PowerShell command

For now, there is not much information in the help but the naming convention is explicit and we can easily understand the role of each of those:

Cmdlet

Definition

Add-PackageSource

Add a new Software Repository

Find-Package

Search a package from one or more repositories

Get-Package

Get the package installed locally

Get-PackageSource

Get the Software Repositories

Install-Package

Install a Package

Remove-PackageSource

Remove a Package Source

Uninstall-Package

Uninstall a Package

No help or examples for now (Find-Package Cmdlet)

Additional Cmdlet Get-PackageProvider ?

Note that we can also expect a new cmdlet called Get-PackageProvider</b>in the final version from what we see in the manifest.

Workflow

From my understanding this is how the OneGet module interact with the package manager like Chocolatey.

Load OneGet module in PowerShell. OneGet is the common interface for interacting with any Package Manager (Plugins).

Then use a Provider for each Package Manager that plugs into OneGet. (Providers do all of the actual work, fetching content from the repositories and doing the actual installation.)

The package manager will then query its software repository to retrieve the package. In this example Chocolatey use it’s own set of Cmdlets (see below in this post)

The package manager then download a configuration file OR get the URI where it will find the instruction to install the package. In the case of Chocolatey, a configuration file is downloaded from the repository and saved locally in C:\Chocolatey\lib<APPNAME>\Tools,

The Provider will then execute the configuration file and download the actual software (+ its dependencies) from a repository, and obviously install it…. silently :-)

Chocolatey Cmdlets
If we look at the files in the module directory, Chocolatey comes with its own set of Cmdlets. (Available on the Chocolatey GitHub repo)
C:\Windows\System32\WindowsPowerShell\v1.0\Modules\OneGet

Chocolatey Provider Cmdlets Helpers (Helpers.psm1)

Chocolatey Cmdlets (Chocolatey.psd1)

Using the module

Get the packages already installed

Since I’ve been using chocolatey for a while, Using Get-Package</b>, OneGet is able to retrieve the all the package I installed on this PC.

Find and install a new package

Now if I want to install a package, that’s very easy: Install-Package</b>
We first search for the package