For the holidays this year we put together a fun fact or interesting feature each day during December. We called it the 24 TIL's of Chocolatey.
A TIL is a commonly used acronym for today I leared. Which is apt, because we posted in our Discord today-i-learned channel alongside Twitter. But, in case you missed them here is each TIL listed below in order:
- Day 1: Chocolatey was first released on 23 March 2011. That makes Chocolatey 10 years old!
- Day 2: If you already have software installed on your computer, but you want to manage it with Chocolatey going forward, then there is a solution to it without installing the software again. One way of doing this is to use the
--skip-powershellswitch. By running
choco install vlc --skip-powershell, Chocolatey CLI will install the latest vlc package, but not run any of the PowerShell scripts, including
chocolateyInstall.ps1. So the software won't actually be installed again. Once that is done you can run
choco upgrade vlcto upgrade to the next latest version when it's available!
- Day 3: You can enable PowerShell tab completion for use with Chocolatey CLI. Find out more in our docs, or watch this fantastic video created by our Senior Software Developer, Gary Ewan Park.
- Day 4: Windows requires the majority of software installations to be done with elevated privileges. Chocolatey works really well when combined with gsudo, so that you can run
sudo choco install <packageName>from a non-elevated terminal!
- Day 5: Did you know you can extend the functionality of the Chocolatey CLI using extensions? Extensions are PowerShell modules that are created as Chocolatey packages and installed, upgraded and uninstalled in the familiar way! See the docs for more information.
- Day 6: Chocolatey remembers arguments previously used during package installations and can reuse these arguments during upgrade by enabling the feature
choco feature enable --name=useRememberedArgumentsForUpgrades) or by passing in the switch
--use-remembered-arguments. See the docs for more information.
- Day 7: Did you know that you can extend the
choco newcommand to use your own custom templates? This makes creating tailored Chocolatey packages, with your own conventions, really simple! See the docs for more information.
- Day 8: Did you know that the Chocolatey documentation site is fully open source? And we welcome contributions! You can learn how to contribute using this video playlist.
- Day 9: Did you know that if you run
choco upgrade <packagename>that Chocolatey CLI will helpfully install the package if it's not already installed? If you want to turn off this behaviour, then run
choco feature enable --name=skipPackageUpgradesWhenNotInstalledto enable the feature. See the docs for more information.
- Day 10: Did you know that if you are a Chocolatey For Business customer, you can pin a package and store the reason why? Add the
--pin-reason=<NOTE>switch to the normal
choco pincommand to do so! See the docs for more information.
- Day 11: Did you know that Chocolatey For Business customers can add their organizational logo to Chocolatey GUI? See the docs for more information.
- Day 12: Did you know that the Chocolatey Automatic Uninstaller attempts to uninstall the software a package may have installed, even if the package does not include an uninstall script? You can manage its behaviour using the
autoUninstallerfeature. See the docs for more information.
- Day 13: Did you know that in Chocolatey For Business you can use auditing to find out who installed a package and when? Just run
choco list -lo --audit. If it was installed through Self Service it will show you the original requesting user as well! See the docs for more information.
- Day 14: Chocolatey includes its own PowerShell Host that will time out calls to
Read-Hostor any other prompt for choice when
-yis passed. This means you can prompt the user during package install / upgrade if necessary, but it will not block headless deployments. You can use the system PowerShell host using the
--use-system-powershellswitch or by enabling the
powershellHostfeature. See the docs for more information.
- Day 15: Did you know that Chocolatey supports FIPS compliant organizations? Simply enable the
useFipsCompliantChecksumsfeature to use FIPS compliant generated checksums. See the docs for more information.
- Day 16: Did you know you can add all the Chocolatey packages you want to install, with parameters, to a
packages.configfile and install them with one command? This is fantastic when you get a new computer! See the docs for more information.
- Day 17: Did you know Chocolatey CLI provides enhanced exit codes for the search, list, info and outdated commands? Enable the
useEnhancedExitCodesfeature and exit code 2 is returned if the command does not produce any results. This is really handy in scripts! See the docs on the individual commands for more information.
- Day 18: If you use Chocolatey For Business in Self-Service / Background Mode you can restrict the commands / actions that end users can perform by configuring
backgroundServiceAllowedCommands. By default install and upgrade are allowed but uninstall is not! See the docs for more information.
- Day 19: Did you know in Chocolatey CLI you can stop install, upgrade or uninstall of packages when a reboot request is detected. Simply enable the features
exitOnRebootDetected. See the docs for more information.
- Day 20: Did you know you can export your currently installed packages in Chocolatey GUI using the Export button? Did you know can also do this in Chocolatey CLI using the
exportcommand? Once the export is complete, you will have a
packages.configfile you can use in a
choco install packages.configcommand on any other computer! See the docs for Chocolatey GUI and Chocolatey CLI.
- Day 21: Chocolatey shims executables to keep your PATH clear and runs the target where it is, meaning required dependencies are all used from the original location! We like to call this "batch redirection that works". See the docs for more information.
- Day 22: Did you know that Chocolatey For Business can show all installed Chocolatey packages in Programs and Features on Windows? This allows reporting tools that only see Programs and Features software, to report on Chocolatey packages too! Simply enable the
showAllPackagesInProgramsAndFeaturesfeature. See the docs for more information.
- Day 23: Did you know that you can add parameters to a package when you create it? Package parameters is one of the most powerful features of Chocolatey packages! It allows the installation / upgrade to be customised by allowing the user to provide information to the package in the form of license names, keys or even switches to allow, for example, shortcuts to be created on the desktop (or not). Whatever your imagination allows! We even provide a Chocolatey helper function
Get-PackageParametersto help you parse them! See the docs for more information on creating Package Parameters and on the Chocolatey helper.
- Day 24: Did you know that the Chocolatey Community Repository hit 1 BILLION package downloads in May 2020 and is at 1.6 BILLION today? See our blog post for that milestone and the Chocolatey Community Repository timeline (work in progress).
We hope you learned some things from our TIL's this December.
While 2021 will go down in the history books as a difficult year for all of us, we're excitedly looking forward to what is to come in 2022 and how we can continue to empower our customers with the power of simple.
- #news 51 Number of post with tag news
- #press release 40 Number of post with tag press release
- #chocolatey for business 19 Number of post with tag chocolatey for business
- #open source 10 Number of post with tag open source
- #how to 5 Number of post with tag how to
- #chocolatey community repository 4 Number of post with tag chocolatey community repository
- #packaging 4 Number of post with tag packaging
- #announcements 3 Number of post with tag announcements
- #azure 3 Number of post with tag azure
- #conference 3 Number of post with tag conference