As of now, OneGet is available in Powershell version 5 which comes with Windows 10 Technical Preview. You can also utilize OneGet on Windows 8.1 if you upgrade Powershell to version 5 with the Windows Management Framework Preview which is available here.
In this tutorial, I will assume you are going the Windows 10 route as I find updating Windows to 8.1 to be too time consuming for my tastes.
Obtain a free copy of Windows 10 TPAt the time of writing (3/6/15) you can head over to their download page and download a free copy of Windows 10 TP. Go ahead and install this to a virtual manchine or to a test box.
Enable the Ability to run Powershell ScriptsBefore we get started, we must first enable the ability to run Powershell scripts in your Windows environment. By default, Windows will allow you to run Powershell but will not allow externally generated Powershell scripts to be run. Oneget and Chocolaty typically run Powershell scripts to finalize the installation of applications installed from OneGet.
Open up an administrator Powershell console
- type Win + r to pop open a run command window and type
- Either right click on the Powershell icon on your taskbar and click "Run as Administrator" or type the following into your current Powershell console
Start-Process powershell -Verb runas
Enable Powershell scripts
- in the administrator powershell window, run the following
- In the above command, I set the execution policy to unrestricted. If you want to be more secure, you can chose a more restricted execution level. Details on the execution policy settings can be found here
Close your admin window
- For the rest of this tutorial, we will be using the non-administrator Powershell console. If you have closed it, go ahead and open it again and close the admin console by clicking the close button in the top right corner or by typing
Install the NuGet package
- Before we start installing packages, we have to install the NuGet package. The NuGet package management tool is used to manage software dependancies of all of the packages we will be installing. You can find more about NuGet here.
- Note: during the nuget.vs install step, you may see an error. Just go ahead and install it and ignore the error. I have not found a solution for properly avoiding the error in this step. The error does not seem to affect anything.
Find a package to install:
- This step is optional, but it shows how we can search for packages with OneGet. In this example, we are looking for the Windows SSH package named Putty.
Install a package:
- Once we know our package exists in our application repositories, we can install it with the following command.
Run your newly installed application
- That's it!!! Most applications get installed to the directory . To start up the example putty application we installed in the previous step, run the following:
Post a Comment