This is not ment to be an enterprise solution, more ment to be a quick way to install application on very small customers or your test/developer computer.

Make sure you are running Windows 10, there are ways to run this on other OSes and versions as well, but I will not cover that scenario here.

I will be running non-domain joined Windows 10 Pro to demostrate this, first fire up PowerShell as administrator.

Hit the command below and it will show you all relevant commands for manage package and packageproviders

Get-Command –Module PackageManagement

image

 

To get applications installed you need to change the execution policy to unrestricted. If you don’t this this the applications will not install and you need to uninstall the application and install it again.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned –Force

Note! This will lower your PowerShell security to allow scripts to run that are not signed locally.

 

If you haven’t added the package providers (chocolatey and nuget) yet you need to do that, but when you are running the commands it will ask you to install what is missing

 

Install application

Now, how do we install Notepad++? Just write Install-Package and your application name.

Install-Package notepadplusplus

image

If this is the first time you run the command without package providers installed it will probably look something like this

image

So instead you need to write the command like this and specify the source/package provider for installation

Install-Package -Provider chocolatey notepadplusplus

image

 

Uninstall application

If you need to uninstall an application just switch the command to Uninstall-Package

Uninstall-Package notepadplusplus

 

Search for an application

How do I search the chocolatey library?

Find-Package –Provider chocolatey office365

Change office365 to what every you are searching for, or skip it to list all applications available

image

If you run the command for the first time without package providers it will look like this

image

 

Installation the package providers manually

If you would like to install the package providers manually you can use these commands

First find out that Windows 10 know about chocolatey and nuget by the command find-package

Find-Package –Provider Bootstrap

image

And now just ask for the providers and it will install for you

Get-PackageProvider chocolatey

Get-PackageProvider nuget

 

Here is a small script to show you how to automate the installation of two applications, feel free to update as you would like. Download here

Advertisements