mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 20:26:49 +00:00
Fix issue where GetPackerTemplatePath fails in PS5 (#8852)
This commit is contained in:
committed by
GitHub
parent
66991d2b2c
commit
d7c36f2257
@@ -17,20 +17,21 @@ Function Get-PackerTemplatePath {
|
|||||||
)
|
)
|
||||||
|
|
||||||
switch ($ImageType) {
|
switch ($ImageType) {
|
||||||
|
# Note: Double Join-Path is required to support PowerShell 5.1
|
||||||
([ImageType]::Windows2019) {
|
([ImageType]::Windows2019) {
|
||||||
$relativeTemplatePath = Join-Path "windows" "templates" "windows-2019.json"
|
$relativeTemplatePath = Join-Path (Join-Path "windows" "templates") "windows-2019.json"
|
||||||
}
|
}
|
||||||
([ImageType]::Windows2022) {
|
([ImageType]::Windows2022) {
|
||||||
$relativeTemplatePath = Join-Path "windows" "templates" "windows-2022.json"
|
$relativeTemplatePath = Join-Path (Join-Path "windows" "templates") "windows-2022.json"
|
||||||
}
|
}
|
||||||
([ImageType]::Ubuntu2004) {
|
([ImageType]::Ubuntu2004) {
|
||||||
$relativeTemplatePath = Join-Path "ubuntu" "templates" "ubuntu-20.04.json"
|
$relativeTemplatePath = Join-Path (Join-Path "ubuntu" "templates") "ubuntu-20.04.json"
|
||||||
}
|
}
|
||||||
([ImageType]::Ubuntu2204) {
|
([ImageType]::Ubuntu2204) {
|
||||||
$relativeTemplatePath = Join-Path "ubuntu" "templates" "ubuntu-22.04.pkr.hcl"
|
$relativeTemplatePath = Join-Path (Join-Path "ubuntu" "templates") "ubuntu-22.04.pkr.hcl"
|
||||||
}
|
}
|
||||||
([ImageType]::UbuntuMinimal) {
|
([ImageType]::UbuntuMinimal) {
|
||||||
$relativeTemplatePath = Join-Path "ubuntu" "templates" "ubuntu-minimal.pkr.hcl"
|
$relativeTemplatePath = Join-Path (Join-Path "ubuntu" "templates") "ubuntu-minimal.pkr.hcl"
|
||||||
}
|
}
|
||||||
default { throw "Unknown type of image" }
|
default { throw "Unknown type of image" }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user