{"id":14063549,"url":"https://github.com/dougbw/pwsh-terrafun","last_synced_at":"2026-01-16T22:29:59.788Z","repository":{"id":38997131,"uuid":"400526743","full_name":"dougbw/pwsh-terrafun","owner":"dougbw","description":"Oh no! its another version manager for terraform","archived":false,"fork":false,"pushed_at":"2022-06-24T09:41:39.000Z","size":210,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-13T07:05:13.368Z","etag":null,"topics":["powershell","terraform"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dougbw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-27T13:58:22.000Z","updated_at":"2023-11-14T18:42:53.000Z","dependencies_parsed_at":"2022-09-08T21:40:41.485Z","dependency_job_id":null,"html_url":"https://github.com/dougbw/pwsh-terrafun","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougbw%2Fpwsh-terrafun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougbw%2Fpwsh-terrafun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougbw%2Fpwsh-terrafun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dougbw%2Fpwsh-terrafun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dougbw","download_url":"https://codeload.github.com/dougbw/pwsh-terrafun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228028481,"owners_count":17858340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","terraform"],"created_at":"2024-08-13T07:03:23.600Z","updated_at":"2026-01-16T22:29:59.774Z","avatar_url":"https://github.com/dougbw.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"![Azure DevOps builds (branch)](https://img.shields.io/azure-devops/build/dougbw/terrafun/29/main)  ![Azure DevOps coverage (branch)](https://img.shields.io/azure-devops/coverage/dougbw/terrafun/29/main) ![Azure DevOps tests](https://img.shields.io/azure-devops/tests/dougbw/terrafun/29)\n![GitHub issues](https://img.shields.io/github/issues/dougbw/pwsh-terrafun)\n\n\n![terrafun](logo.png)\n\n![demo](demo.gif)\n\n# Table of Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n3. [Commands](#commands)\n4. [How to set terraform version](#how-to-set-terraform-version)\n\n# Terrafun\nTerrafun is a tool for managing terraform versions. It enables seemless switching between different terraform versions which can be controlled by an environment variable, file, or user profile. It has been written in PowerShell but has been designed to support being used across multiple platforms and from different shells.\n\n# Features\n* terraform version management\n\n# Installation\n\n![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/terrafun)\n![PowerShell Gallery Version](https://img.shields.io/powershellgallery/v/terrafun)\n\nOnce you have [PowerShell installed](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.1) this module can be installed from the from the [PowerShell Gallery](https://www.powershellgallery.com/packages/Terrafun/).\n\n## Supported platforms:\n\n| OS        | Edition           | Build  |\n| :------------- |:-------------:| -----|\n| Windows  | `Windows PowerShell (v5)` | [![Build Status](https://dev.azure.com/dougbw/terrafun/_apis/build/status/dougbw.pwsh-terrafun?branchName=main\u0026stageName=Test\u0026jobName=Run%20tests\u0026configuration=Run%20tests%20windows-powershell)](https://dev.azure.com/dougbw/terrafun/_build/latest?definitionId=29\u0026branchName=main) |\n| Windows | `PowerShell Core (v6+)` | [![Build Status](https://dev.azure.com/dougbw/terrafun/_apis/build/status/dougbw.pwsh-terrafun?branchName=main\u0026stageName=Test\u0026jobName=Run%20tests\u0026configuration=Run%20tests%20windows-core)](https://dev.azure.com/dougbw/terrafun/_build/latest?definitionId=29\u0026branchName=main) |\n| Linux | `PowerShell Core (v6+)` | [![Build Status](https://dev.azure.com/dougbw/terrafun/_apis/build/status/dougbw.pwsh-terrafun?branchName=main\u0026stageName=Test\u0026jobName=Run%20tests\u0026configuration=Run%20tests%20linux-core)](https://dev.azure.com/dougbw/terrafun/_build/latest?definitionId=29\u0026branchName=main) |\n| MacOs | `PowerShell Core (v6+)` | [![Build Status](https://dev.azure.com/dougbw/terrafun/_apis/build/status/dougbw.pwsh-terrafun?branchName=main\u0026stageName=Test\u0026jobName=Run%20tests\u0026configuration=Run%20tests%20macos-core)](https://dev.azure.com/dougbw/terrafun/_build/latest?definitionId=29\u0026branchName=main) |\n\n## Installation (in pwsh)\n```powershell\nInstall-Module terrafun -Force\n```\n\n## Installation (in anything else)\n```bash\npwsh -c \"Install-Module terrafun -Force\"\n```\n\n## Update (in pwsh)\n```powershell\nUninstall-Module -Name terrafun -AllVersions -Force\nInstall-Module terrafun -Force\n```\n\n# Usage\n\nInstall the module and simply run `tf` in place of `terraform`. \n E.g:\n```powershell\ntf version\ntf init\ntf plan\ntf apply\n```\n\n## Usage in other shells\nYou can use this from other shells (bash, zsh, sh, etc) through aliases providing you have a working PowerShell installation on your workstation. You can create aliases named to `terraform` instead of `tf` if you prefer.\n\n* Install PowerShell on your machine\n* Install the module using the instructions above\n* Create an alias for your actual shell, examples below....\n\n### bash alias\n```bash\necho \"alias tf='pwsh -c tf'\" \u003e\u003e ~/.bashrc\nalias tf='pwsh -c tf'\n```\n### zsh alias\n```zsh\necho \"alias tf='pwsh -c tf'\" \u003e\u003e ~/.zshrc\nalias tf='pwsh -c tf'\n```\n\n# Commands\n\nOther than a couple of commands for version management you use `tf` exactly the same as if you are executing `terraform` directly.\n\n\n| Command        | Description           |\n| ------------- |:-------------:|\n| `tf version list`     | list available terraform versions |\n| `tf version \u003cversion\u003e`      | set a specific version of terraform for the current directory      |\n| `tf version \u003cversion\u003e global` | set a specific version of terraform across your user profile      |\n\n\n# How to set terraform version\n\nThere are three methods for selecting the desired version of terraform, prioritized in the following order:\n\n1. Environment Variable\n2. File\n3. User Profile\n\n## Environment Variable method\nSet the `terraformversion` environment variable and you will get that version of terraform\n\n### bash\n```bash\nterraformversion=\"1.0.0\"\ntf\n```\n\n### PowerShell\n```powershell\n$env:terraformversion = \"1.0.0\"\ntf\n```\n\n## File method\nUse the `tf version {version}` command which will save the version into a file named `.terraformversion` in the current directory.\n```bash\ntf version 0.13.5\n```\n\n\n## User Profile method\nUse the `tf version {version} global` command which will store the version infomation in a config file within your user profile: `~/.terrafun/config.json`\n```bash\ntf version 0.13.5 global\n```\n\n# Binary install location\nBinaries are downloaded to the following directory in your user profile:\n```\n ~/.terrafun/terraform_{version}_{platform}_{arch}/terraform(.exe)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougbw%2Fpwsh-terrafun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdougbw%2Fpwsh-terrafun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdougbw%2Fpwsh-terrafun/lists"}