How to uninstall Terraform and install newer version on Windows


I was continuing my journey of how to deploy Oracle Hyperion on OCI and just started following some basic steps as outlined in this reference link Set up the infrastructure to deploy Oracle Enterprise Performance Management.

What I have realized that on my laptop I have already Terraform v0.13.5 installed. To use this method I need to have Terraform v0.11.x therefore I have to downgrade my Terraform version.

I have downloaded the ‘terraform_0.11.13_windows_amd64’ from the older version page and was stuck on how to uninstall the earlier version. Here is what I have found and documented for future reference:

How to uninstall Terraform

How do I downgrade my terraform version?

In the windows start, open PowerShell and run as an administrator.

Install Chocolatey if it is not already on the laptop. (this was already installed on my laptop, a week ago, while practicing something else)

Then run 

choco uninstall terraform

terraform-uninstall How to uninstall Terraform and install newer version on Windows

Now I will install my required version, which was earlier downloaded from the Terraform site

‘terraform_0.11.13_windows_amd64’

How to install Terraform on Windows

We need to just unzip it and then move the file to any place/drive on the laptop and then enter the file in the environment path

for example, I have moved it to my program files so here is the path file, and here is the link to This Stack Overflow article contains instructions for setting the PATH on Windows.

Go to Control Panel -> System -> System settings -> Environment Variables.
Scroll down in system variables until you find PATH.
Click edit and change accordingly.
BE SURE to include a semicolon at the end of the previous as that is the delimiter, i.e. c:\path;c:\path2
Launch a new console for the settings to take effect.

you can see in this below picture my earlier version and after going through the above steps the new version (which is an older version)

Terraform-install How to uninstall Terraform and install newer version on Windows

Update: 4-Jan-2021: I have downloaded the new version (which I want to have) and just replaced the exe file with the new one and it worked 🙂 without going through of un-installing process. just sharing with you another behavior that I have noticed.