Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,21 @@
}
}

$os = ""
if ($IsWindows) {
$os = "windows"
}
if($IsLinux) {
$os = "linux"
}
if($IsMacOS) {
$os = "darwin"
}

$unzipdir = Join-Path -Path $TOOLS_PATH -ChildPath "terraform_$TF_VERSION"
if (Test-Path $unzipdir) {
Write-Host "Terraform $TF_VERSION already installed."
if($os -eq "windows") {

Check failure on line 54 in alz/azuredevops/pipelines/terraform/templates/helpers/terraform-installer.yaml

View workflow job for this annotation

GitHub Actions / copilot

54:1 [trailing-spaces] trailing spaces
$env:PATH = "$($unzipdir);$env:PATH"
} else {
$env:PATH = "$($unzipdir):$env:PATH"
Expand All @@ -49,17 +60,6 @@
return
}

$os = ""
if ($IsWindows) {
$os = "windows"
}
if($IsLinux) {
$os = "linux"
}
if($IsMacOS) {
$os = "darwin"
}

# Enum values can be seen here: https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.architecture?view=net-7.0#fields
$architecture = ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture).ToString().ToLower()

Expand Down
Loading