Lately I am very keen on learning DSC and I am using Microsoft Virtual Academy tutorial Getting Started with PowerShell Desired State Configuration (DSC). In last lesson there is Linux DSC configuration task, and application I needed to install was Putty. OK I said! Lets do it with PowerShell.
What is OneGet? It is package installer that give you ability to browse, install, update and uninstall software packages from online or local provider. It is what Linux have long time ago (APT-Get –Debian, yum – CentOS ….) I already had installed WMF 5.0 (aka PowerShell 5.0) and OneGet module . You can find all instruction and downloads on links I provided.
How it works. I stole this part from this blog just to show workflow but you can read it all if you like.
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 🙂
Lets do it. If you have all set up run this line
As you can see there is a list of all putty software packages available. we will jus simple use
It will install automatically putty and putty portable like software dependency. I was already installing putty so folders already existed, but first time install it will be created. So where it is. You can find all package installations under c:\chocolatey\lib by default. If you want to install software under different folder you can use –Destination parameter in install-package command
Lets go find putty
Run it and V’oila . Putty is there