Skip to content

Commit 2bb6024

Browse files
committed
update tenv
1 parent f3d24b1 commit 2bb6024

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

PowerShellModules/Tenv.psm1

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
function Invoke-InstallTenv
2-
{
1+
function Invoke-InstallTenv {
32
[CmdletBinding()]
3+
param()
44

55
$inv = $MyInvocation.MyCommand.Name
66
$os = Assert-WhichOs -PassThru
77

8-
if ($os -eq 'windows')
9-
{
10-
Assert-ChocoPath
11-
_LogMessage -Level INFO -Message "Installing tenv via Chocolatey…" -InvocationName $inv
12-
choco install tenv -y
8+
if (-not (Get-Command tenv -ErrorAction SilentlyContinue)) {
9+
if ($os -eq 'windows') {
10+
Assert-ChocoPath
11+
_LogMessage -Level INFO -Message "Installing tenv via Chocolatey…" -InvocationName $inv
12+
choco install tenv -y
13+
}
14+
else {
15+
Assert-HomebrewPath
16+
_LogMessage -Level INFO -Message "Installing tenv via Homebrew…" -InvocationName $inv
17+
brew install tenv
18+
}
1319
}
14-
else
15-
{
16-
Assert-HomebrewPath
17-
_LogMessage -Level INFO -Message "Installing tenv via Homebrew…" -InvocationName $inv
18-
brew install tenv
20+
else {
21+
_LogMessage -Level INFO -Message "tenv already installed." -InvocationName $inv
1922
}
2023
}
2124

25+
2226
function Test-TenvExists
2327
{
2428
try

Run-AzTerraform.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ param (
1919
[string]$TerraformPlanFileName = "tfplan.plan",
2020
[string]$TerraformDestroyPlanFileName = "tfplan-destroy.plan",
2121
[string]$TerraformCodeLocation = "terraform",
22-
[string[]]$TerraformStackToRun = @('rg'),
22+
[string[]]$TerraformStackToRun = @('rg'), # Use 'all' to run 0_, 1_, etc and destroy in reverse order 1_, 0_ etc
2323
[string]$CreateTerraformWorkspace = "true",
2424
[string]$TerraformWorkspace = "dev",
2525
[string]$InstallAzureCli = "false",

0 commit comments

Comments
 (0)