pearcec/Invoke-Terraform

Install-Terraform must install the latest version if no given version

lktslionel opened this issue · 4 comments

Acceptance tests

  • Given No args, When I run the command Install-Terraform Then It should install the latest version of Terraform available
  • When I run the command Install-Terraform with the version label "latest", Then It should install the latest version of Terraform

I was considering -TFVersion 'latest' or -Lastest as a second parameter set. Using -Lastest keep the usage of TFVersion clean.

Parameter set doesn't make sense. Thinking removing mandatory grabs the latest for you.

The parameter -Latest looks great and more PowerShell-idiomatic.

Trouble with the -Latest is making that default breaks PSScriptAnalayzer. It encourages you to avoid default values on a switch. I think leaving out the version going with the latest is good default behavior.