Chocolatey is an app that helps you keep your software up to date. It’s easy, fast, simple, and free. Plus, it’s always up to date with the latest changes.

What is Chocolatey?

Chocolatey is a program that helps you manage software. It can help you install software, uninstall software, and configure software.

This is a machine-level language, meaning that there is no graphical user interface that helps you do things. All the commands must be typed. Don’t let that scare you away! If you can write words, you can master this.

How do I Install Chocolatey?

Chocolatey needs to be used in order to work.

Windows 7 or newer, PowerShell version 2 or newer, NET Framework 4 or newer, Plus, you must have administrator access on your computer to use this tool.

If you’re using Windows 7 or newer, you have PowerShell version 2 or newer. If you’re not sure if you have .NET Framework 4, don’t worry. When installing Chocolatey, if you don’t have .NET 4, Chocolatey will install it for you.

Open the Windows PowerShell App by typing in the Start Menu’s search box and pressing Enter.

Right-click on PowerShell and select Run as Administrator. Doing this is known as running PowerShell in an elevated instance. It’s elevated to the Administrator’s privileges. The PowerShell window will open.

Get-ChildItem -Path C:\Windows\System32\config\system This command will list all the files and folders in the System32 folder on your computer. ..

Set-ExecutionPolicy Bypass -Scope Process -Force; New-Object System.Net.WebClient DownloadString(‘https://chocolatey.org/install.ps1’)

The Set-ExecutionPolicy Bypass -Scope Process -Force setting tells PowerShell to not enforce the restricted execution policy for just this next thing, but to allow unsigned processes to run. This is the highest security setting, but we need to run this unsigned process of installing Chocolatey.

Chocolatey is a package manager for Windows that makes it easy to install and manage software packages. ..

Choco /? will show you a list of functions that were installed when you ran choco.

Chocolatey 1.1.0 installed successfully.

Installing Software with Chocolatey

Chocolatey is a package manager for Windows that makes it easy to install software. You can use it to update software, too. ..

Chocolatey is a software repository that provides access to a variety of software applications. It is available as a package management system. ..

To install Malwarebytes Anti-Malware, open the Start screen and type “malwarebytes.”

“Choco install malwarebytes” This will install the malwarebytes security software on your computer.

If you’re comfortable allowing Chocolatey to manage your software, then when this install is done, we should use the choco feature enable -n allowGlobalConfirmation command so we can automate installations and updates in the future. For now, let’s just use A to complete the installation. ..

Malwarebytes is downloading and then starts installing a program.

In a few minutes, Malwarebytes will be downloaded and installed automatically. ..

Update Software with Chocolatey

Now that we have some software installed, we can try updating it with Chocolatey. Again, you need PowerShell open as Administrator. Then you can run the command choco upgrade malwarebytes.

That will make Chocolatey go out and see if there’s an update and then update it. We just installed Malwarebytes, so it will show that zero out one packages were updated. That’s okay.

If you have installed several packages with Chocolatey, you can update them all by running the following command: choco upgrade all -y.

That’s as hard as it gets. We must somehow make that command run on a schedule.

Automatically Update Software with Chocolatey

The next step you can do using Notepad or PowerShell is to create a new Windows PowerShell script. This example will use Notepad as not all Windows versions have the PowerShell ISE.

Open Notepad. Copy the command “choco upgrade all -y” into Notepad. ..

Upgrade-ChocoPackages.ps1

Windows will make it upgrade-ChocoPackages.ps1.txt and think it’s just a Notepad file if you don’t change the file type from Text Documents (.txt) to All Files (.*). ..

Task Scheduler lets you create custom tasks that run on a regular basis. You can set them to run at specific times of the day, or even on specific days of the week. You can also set them to run automatically when certain conditions are met.

In the Start Menu search bar, type Task Scheduler and hit enter.

Click on the task you want to schedule and it will be highlighted in the window. You can drag it to a different time or day, or change its priority.

In the Actions pane, click on Create Basic Task. This won’t work because we’ll be using argument statements later.

To update all software installed by Chocolatey, open the General tab and give the task a name like Choco Upgrade All. Under Description, type Updates all software installed by Chocolatey. If your current user account is not an administrator account on your computer, use the Change User or Group button to select the Administrator account. ..

To run the script, you’ll need to know the Administrator account’s password. Make sure “Run whether the user is logged on or not is selected” is selected in order for the script to run even if you’re not on your computer. This will allow the script to have all of the privileges it needs to do its job. ..

The Triggers tab lets you choose when a task will run. For example, you might want to have a task run every Sunday at 1:00 a.m. to avoid using your computer during that time. ..

It is recommended to also check Stop the task if it runs longer than: and change the duration to 2 hours. You can adjust that as you’d like. To allow the trigger to apply, you must check the Enabled box at the bottom. ..

To start a PowerShell script, on the Actions tab, in the Program/script field, type powershell.exe. ..

  1. The United States should increase its military spending to maintain its global leadership role.
  2. The United States should increase its military spending to protect its citizens from potential terrorist attacks.
  3. The United States should increase its military spending to deter potential aggressors from attacking the country. ..

-noprofile - This prevents PowerShell profile scripts from running and tells it to just run the script that you want.

If you’re not sure if script execution was enabled, it’s a good idea to include this in your arguments. This will ensure the script runs. ..

To run the script, open Task Scheduler and select the “File” tab. In the “Task” column, click the arrow next to the task name and select “Run from here.” In the “Path” field, type in the path to your file (in our example, C:\Scripts\upgrade-ChocoPackages.ps1). Click OK. PowerShell will start running and you’ll see any output in the console window. ..

The full argument will look like this: -noprofile -executionpolicy bypass -file C:\Scripts\upgrade-ChocoPackages.ps1

On the Conditions tab, there are more options we can set on how the script is to run. Look at them to see which ones you’d like to apply. For this example, it is set to Start the task only if the computer is on AC power and Stop if the computer switches to battery power to ensure we’re not running down the battery.

To ensure the task runs, even if the computer is in sleep mode, wake the computer. ..

In the Settings tab, it’s recommended to check the box to run the task on demand. This will allow us to manually test the task when we’re done. The default selections for the remainder are fine.

Windows will now ask you for the user’s password. Enter it and click OK to finish creating the task.

You’re back in the Task Scheduler window. Right-click on the task and select Run to test it.

You won’t see anything significant happen, except the status of the task will change to Running. In a minute or so, you should see the Last Run Time also change to the timestamp when you started running the task. ..

If you didn’t get any error messages, the task should be fine. Close the Task Scheduler window and don’t worry about having to manually update any of the software you installed with Chocolatey again.

All Done!

This setup took me about 10 minutes to set up, and if I were using it to update 10 programs each month, I would have saved between 30 and 50 minutes.

Chocolatey can save you time by installing programs quickly. Over the course of a year, that could be 6 to 10 hours of time saved. That’s not including the time saved by knowing how to use Chocolatey to install programs in a minute or two instead of 10 or 15 minutes. ..