SID-500

Home » PowerShell » Package Management in PowerShell (Chocolatey)

Package Management in PowerShell (Chocolatey)

Tired of installing 3rd party software? So far, 7zip, winrar, Chrome, Adobe Reader, Java etc … has to be downloaded manually. This is over now. Package Management in PowerShell is here! Online repository is the keyword. Install multiple software in silent mode with PowerShell. Here we go …

Checking Prerequisites

First, we check if PowerShell allows to run scripts. The execution policy should be configured to unrestricted.

Get-ExecutionPolicy
Set-ExecutionPolicy Unrestricted

Unbenannt.PNG

Installing the Packageprovider Chocolatey

Get-PackageProvider checks the available provider packages.

Get-PackageProvider

Unbenannt.PNG

No Chocolatey. Let´s continue with Find-Package. Press Y to install the NuGet Provider.

Find-Package

Unbenannt.PNG

Now we can move on. We install the Package Provider Chocolatey. Press Y to install it.

Get-PackageProvider -Name chocolatey

Unbenannt.PNG

The NuGet and Chocolatey provider should now appear in the list of Package Providers.

23a.PNG

Package Management in Action

Let´s search for 7zip.

Find-Package -Name *7zip*

24

Next we use Install-Package to install 7zip.

Install-Package -Name 7zip

25

Installing simultaneously

Or install packages simultaneously.

Install-Package -Name 7zip, WinRAR, Opera

Unbenannt

Find more Software

You can search for more Software with Find-Package.

Find-Package -ProviderName chocolatey

Unbenannt.PNG

The number of software packages is amazing.

Unbenannt.PNG

Safety Note

Can we trust chocolatey? I am not sure. For private use its ok. But for professional use i recommend to create your own Package Provider.


3 Comments

  1. Anonymous says:

    Man, I must thank you for that! I had seen a lot about chocolatey while searching for deployment techniques with powershell but never wanted to go on with it, but now with this article I could see I was wasting my time!

    Like

  2. […] If you can´t do without WinZip, I recommend my article Package Management in PowerShell (Chocolatey) […]

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

WHOIS

My name is Patrick Grünauer (pewa2303). I am from Austria. On sid-500 I write about Windows, Cisco and IT-Security in English and German. Have fun while reading!

Patrick Gruenauer
Follow SID-500 on WordPress.com