Creating and publishing Chocolatey packages for powershell Scritps

Chocolatey packages are becoming popular in recent months, there are few reasons for it refer the below list

  1. Easy way to deliver the software consistently.
  2. It can take source from different formats, UNC, Http, private and public.
  3. Behind the scene it is using the Nuget and Powershell to power the software delivery.
  4. Nuget packages are easy way to ship bunch of libraries or scripts around different projects but on the other side chocolatey is used to deploy the applications, configure the server, run the script from sources etc

Now, let’s quickly jump into creating the chocolatey packages and publishing them to

  1. Install Chocolatey find the instructions from or run the below command in the powershell window
    1. iex ((new-object net.webclient).DownloadString(‘’))
  2. Create a nuspec file like as shown below

    This nuspec file contains all the information required for the package we are going to create now. The XML tags are self-explanatory.

    Run this command from powershell cpack .\AutomateThinkable.nuspec -source C:\nugetdemo

    You will be able to see the below output

    Now, we have the package created locally. If you have an account in chocolatey then obtain the ApiKey to publish the package into for moderator to approve it.

    Until then you can use below command in the powershell prompt

    Package details can be found here

    choco install automatethinkable -Version 0.2.6

    Note: if you have a script named as chocolateyinstall.ps1 under the tools folder, then that script will be executed during the package installation. Same way as the uninstall script. We will discuss more details about it in the next post.

    Sweet chocolatey makes package distribution and configuration easier.

    Happy Christmas !!




Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.