Blog‎ > ‎Windows‎ > ‎Windows 10‎ > ‎

Windows 10 powershell's Linux sudo apt-get install like CMDlet with Chocolately app

The Story
Windows 10 has arrived finally and with it came lot of new features, and one of my favorite new features is that you can finally install applications through powershell just like Linux OS's terminal window command (apt-get install).

Although the command is still pretty new and lack many repositories where you can find and install applications from.... there's already some people who are working on adding sources of applications which you can test initially before Microsoft asks product companies to start making their own repositories so Powershell can trust these sites and applications.

One of the sites that are working on providing Windows 10 with repositories is https://chocolatey.org/ which provides hundreds of softwares that can be installed through PS.

To install Chocolately repository simply do the following

Open powershell as an administrator and paste the following cmdlet 

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin 

clip_image001 

Then this 
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) 

clip_image002 

From 
https://chocolatey.org/ 

As soon as you have installed chocolately, you will get a new huge list of applications that can be installed with a very simple and short cmdlet as in the below screenshots. 

The good things about these cmdlets is it can be used to deploy an app for a huge number of clients by simply running the script through GPO or batch file. 

I am going to install VLC and Google drive on my computer using these cmdlet … 

Find-Package 
To find the package you need to simply open Powershell "As Administrator" and type the following cmdlet 
find-package -Name ApplicationName and press enter
That will show the following result

clip_image003 
clip_image004 

Once you find it you can install it

Install-package 

to install, you have to use the cmdlet 

Install-package -Name ApplicationName 

Entering, this should start downloading the application and install it ... if you use the -verbose parameter that should also tell you whether the app is from a trusted repository or not which sometimes is an important issue for some companies. 

clip_image005 
clip_image006 
clip_image007 

After the application is installed, I  will open the list and search for it and it is there. 
Checking if the app is really installed or not? 

clip_image008 

------------------------------------------ 

Find and install google drive package 

Downloading 

clip_image009 

Installing 

clip_image010 

clip_image011 


If an application doesn't install, how to troubleshoot it? 


If for instance you were trying to install a package or app and that doesn't work or get stuck then you can navigate to the Chocolately directory and delete any package that you tried to install but were suspended for any reason. 

c:\Chocolately\lib\ 

clip_image012 

You can simply delete the whole directory or the file that ends with extension .nupkg and try again to install… 

clip_image013 

Hope you find this useful
Comments