Chocolatey Install Powershell
This will install a PowerShell script as a command on your system. Like an executable can be run from a batch redirect, this will do the same, calling PowerShell with this command and passing your arguments to it. If you include a url, it will first download the PowerShell file.
Most Windows users don’t pay much attention to how desktop programs are installed on their system. For years we’ve been trained to seek out a website, download an EXE or MSI file, and then click, click, click our way through the installation.
It’s an easy method, but it’s also time consuming because of the manual interaction.
A burgeoning project called Chocolatey wants to make it easy to install desktop apps without having to click through an interminable number of installation windows.
- Chocolatey puts some batch files on the path that call PowerShell and run the Chocolatey script, passing along the arguments. When Chocolatey runs, it uses NuGet to download packages and work on dependency resolution. Then it searches for and executes the chocolateyInstall.ps1 script if it finds it.
- Aug 23, 2014 - Then along comes Windows PowerShell 5.0 Preview with a module. To install Chocolatey, run the Install.ps1 script from the Chocolatey.
What is Chocolatey?
Chocolatey is a command line application installer for Windows based on a developer-centric package manager called NuGet. Unlike manual installations, Chocolatey adds, updates, and uninstalls programs in the background requiring very little user interaction.
Chocolatey has its own package feed that is created and maintained by the project’s community members.
Behind the scenes, most Chocolatey packages simply download a program’s official executable and install it without any further interaction from the user.
You lost me at “command line”
No, wait, hear me out!
Getting new programs the old fashioned way is very easy, but manual installs are also inefficient. Wouldn’t you rather spend your time checking out the latest cat videos on YouTube while your PC goes about installing programs by itself?
That’s the promise of Chocolatey. If the program has any dependencies, such as the .NET framework, Chocolatey will install those too.
How To Install Chocolatey Windows 10
Chocolatey can also take care of multiple program installations.
Imagine cracking open a new PC, downloading Chocolatey and then typing a one-line command to install all the programs you’d like to have on your new machine. That's what Chocolatey does.
Installing Chocolatey
Getting Chocolatey onto your system is very simple since the commands can be copied and pasted into your command prompt from Chocolatey.org. To start, you need to open an elevated command prompt.
To do this in Windows 8.1, click on the Start button and go to the all apps screen. Under the Windows System heading find Command Prompt, right click-it and select Run as administrator. When the User Account Control window opens, authorize it by clicking Yes.
A command prompt window should open with something like C:WINDOWSsystem32.
Next, visit Chocolatey.org and copy the first box. At this writing, the commands were:
Paste it into the prompt, press Enter and your PC will take care of the rest.
Download windows 2008 r2 x64. Related torrents of 'MICROSOFT WINDOWS SERVER 2008 R2 FOUNDATION RTM WITH SP1 X64 OEM ENGLISH.' Has infrienged your copyrights Your request may take days to process, please wait in patient I'm truly sorry if this happened. Download 'MICROSOFT WINDOWS SERVER 2008 R2 FOUNDATION RTM WITH SP1 X64 OEM ENGLISH.' Sorry, no related torrents found for MICROSOFT WINDOWS SERVER 2008 R2 FOUNDATION RTM WITH SP1 X64 OEM ENGLISH. If by any chance you found this material, aka 'MICROSOFT WINDOWS SERVER 2008 R2 FOUNDATION RTM WITH SP1 X64 OEM ENGLISH.'
Usually doing a copy and paste of commands is not advisable, but in this case it’s just fine.
So you can rest easier, let’s break the instructions down a little bit: These commands are telling your PC to launch PowerShell and don’t load any custom profiles a power user might have. Next, it tells Windows to set the execution policy to unrestricted to allow any PowerShell script to be run and then download and run the Chocolatey install script.
Chocolatey basics
Installing programs Chocolatey style
Once you’ve got Chocolatey up and running, it’s time to start installing programs. Open an administrative command prompt again and type cinst [program name]
.
If you wanted to install VLC you’d type:
Pretty easy, right? The trick is that you need to know the exact name Chocolatey uses for each program. You can’t just type Chrome
or Google-Chrome
and expect Chocolatey to figure it out.
To find the names of programs, you can try playing around on the command line with the trial and error method (which works more often than you’d think). If you don't have that kind of time, search Chocolatey.org’s online package catalog for programs. You can also search for packages right on the command line:
Multiple installs
There are two ways to install multiple programs in one sitting with Chocolatey. The first is to type multiple arguments into the command line. If you wanted to install VLC, GIMP, and Firefox you’d type:
For much larger batches of programs, however, you’re better off creating an XML document with a .config file extension and formatting it like so:
What version of the Anyconnect client are you using? We were having this issue as well and after doing a little reading, I just upgraded our Anyconnect to the latest version. Cisco anyconnect secure mobility client install error.
That basic document structure can include as many programs as you like, and can even include alternative sources other than Chocolatey’s community feed. Deltronic mpc-5 user manual. For a more thorough tutorial on creating a multiple install file, check out developerFusion.
Uninstalling and updating
Updating installed programs via Chocolatey is simple too. Type cup [program name]
into an administrative command. To update DosBox, for example, type:
You can also update all your programs by typing cup all
. If your package is using an alternative source other than the main Chocolatey package feed, you can type:
Uninstalling a package is a little different. Going back to our example, you'd type the following to uninstall DosBox:
On the next page, we'll cover standardized commands and security concerns.
In order to make install scripts and understanding existing ones, I would like to know what happens behind the scenes of the typical:
I found the following here:
Installation
- Chocolatey uses Nuget.Core to retrieve the package from the source.
- Choco determines if it self-contained or has automation scripts - PowerShell scripts (*.ps1 files), and soon to be open to Scriptcs files in the 0.9.10.x timeframe (I know, right?!).
- Choco takes a registry snapshot for later comparison.
- If there are automation scripts, choco will run those. They can contain whatever you need to do, if they are PowerShell you have the full power of Posh (PowerShell), but you should try to ensure they are compatible with Posh v2+.
- Choco compares the snapshot and determines uninstaller information and saves that to a .registry file.
- Choco snapshots the folder based on all files that are currently in the package directory.
- Choco looks for executable files in the package folder and generates shims into the $env:ChocolateyInstallbin folder so those items are available on the path. Those could have been embedded into the package or brought down from somewhere (internet, ftp, file folder share, etc) and placed there.
That given,
How can I get the
.nupkg
package URL? In general it seems like this:Which is the
.nupkg
package download directory?Where is the content of the
.nupkg
package extracted by default? This is important sincechocolateyInstall.ps1
sometime usesSplit-Path -Parent $MyInvocation.MyCommand.Definition
.
'Scriptcs files in the 0.9.10.x timeframe' is rather cryptic. Can you give some references?
Is Posh v2+ simply short for Powershell or is a specific technology?
There are several executable files in
$env:ChocolateyInstalllib
without a link in$env:ChocolateyInstallbin
. For example, thempv.exe
of the mpv player is not linked.
1 Answer
- Yes, that download URL seems correct. The download directory is always into the Chocolatey installation folder, then
libpackageName
, and this is where contents are extracted to. - Right now, installation scripts are only written in PowerShell. This comment is referring to the ability to write in installation scripts in C#, using the ScriptCS run time. Currently, this isn't yet supported.
- Yes, this is just a short way of referring to PowerShell.
- In the case of the mpv package, you will notice that there is an
mpv.exe.ignore
file. The presence of this file in the package prevents a shim being created.