A PowerShell module for Terraform, a tool from Hashicorp for managing infrastructure safely and efficiently.
It will install the following Terraform tools :
It also provides some useful terraform aliases for everyday use.
Install or update from PowerShell Gallery
- Install
Install-Module terraform-tools -Scope CurrentUser -AllowClobber
- Update
Install-Module terraform-tools -Scope CurrentUser -AllowClobber -Force
RemoteSigned
or Unrestricted
.
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
You have to import the module to use terraform-tools
.
Add below command into your PowerShell profile.
Import-Module terraform-tools -DisableNameChecking
Then restart your PowerShell.
- First time : will download, install and add all Terraform tools managed by this module to your user
$PATH
- Then : will only add tools to your
$PATH
Now you can use wanted tool or uses wanted aliases.
🛈 Install terraform command using tfswitch command
tfswitch
If you facing issue with current version of tfswitch, have a look at my fork
New-Item -ItemType File $profile
Here is the list of availabe aliases provides by this module :
Alias | Command |
---|---|
tf |
terraform |
tff |
tf fmt |
tfv |
tf validate |
tfi |
tf init |
tfp |
tf plan |
tfa |
tf apply |
tfd |
tf destroy |
tfo |
tf output |
tfr |
tf refresh |
tfs |
tf show |
tfw |
tf workspace |
tffr |
tff -recursive |
tfip |
tfi & tfp |
tfia |
tfi & tfa |
tfid |
tfi & tfd |
tfa! |
tfa -auto-approve |
tfia! |
tfi && tfa! |
tfd! |
tfd -auto-approve |
tfid! |
tfi && tfd! |
tfversion |
tf version |
tfws |
tfw select -or-create [workspace_name] |
# Show all aliases available in module
Get-TerraformAliases
# Show a specific alias available in module
Get-TerraformAliases [alias_name]
The module comes with a PowerShell function to update all Terraform tools when you want
Update-TerraformTools