Skip to content

Commit 2352928

Browse files
Fix: Move $osArchitecture initialization before first usage in Get-TerraformTool.ps1
Co-authored-by: jaredfholgate <1612200+jaredfholgate@users.noreply.github.com>
1 parent 03e8040 commit 2352928

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ALZ/Private/Tools/Get-TerraformTool.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ function Get-TerraformTool {
3939
}
4040
}
4141

42+
$osArchitecture = Get-OSArchitecture
43+
4244
$unzipdir = Join-Path -Path $toolsPath -ChildPath "terraform_$version"
4345
if (Test-Path $unzipdir) {
4446
Write-Verbose "Terraform $version already installed, adding to Path."
45-
if($os -eq "windows") {
47+
if($osArchitecture.os -eq "windows") {
4648
$env:PATH = "$($unzipdir);$env:PATH"
4749
} else {
4850
$env:PATH = "$($unzipdir):$env:PATH"
4951
}
5052
return
5153
}
5254

53-
$osArchitecture = Get-OSArchitecture
54-
5555
$zipfilePath = "$unzipdir.zip"
5656

5757
$url = $release.builds | Where-Object { $_.arch -eq $osArchitecture.architecture -and $_.os -eq $osArchitecture.os } | Select-Object -First 1 -ExpandProperty url

0 commit comments

Comments
 (0)