mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-08 11:07:18 +08:00
Remove ValidateSet
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
param(
|
param(
|
||||||
[ValidateSet('Windows2019-Azure','Windows2016-Azure','ubuntu1604','ubuntu1804')]
|
|
||||||
[String] [Parameter (Mandatory=$true)] $Image,
|
[String] [Parameter (Mandatory=$true)] $Image,
|
||||||
[String] [Parameter (Mandatory=$true)] $ClientId,
|
[String] [Parameter (Mandatory=$true)] $ClientId,
|
||||||
[String] [Parameter (Mandatory=$true)] $ClientSecret,
|
[String] [Parameter (Mandatory=$true)] $ClientSecret,
|
||||||
@@ -16,9 +15,17 @@ param(
|
|||||||
)
|
)
|
||||||
|
|
||||||
$TemplatePath = (Get-ChildItem -Path "images" -Include "$Image.json" -Recurse -Depth 2).FullName
|
$TemplatePath = (Get-ChildItem -Path "images" -Include "$Image.json" -Recurse -Depth 2).FullName
|
||||||
|
if ($TemplatePath -eq $null)
|
||||||
|
{
|
||||||
|
Write-Error "'-Image' parameter is not valid. You have to specify correct image type."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
$TempResourceGroupName = "${ResourcesNamePrefix}_${Image}"
|
$TempResourceGroupName = "${ResourcesNamePrefix}_${Image}"
|
||||||
$InstallPassword = [System.GUID]::NewGuid().ToString().ToUpper()
|
$InstallPassword = [System.GUID]::NewGuid().ToString().ToUpper()
|
||||||
|
|
||||||
|
packer validate -syntax-only $TemplatePath
|
||||||
|
|
||||||
Write-Host "Build $Image VM"
|
Write-Host "Build $Image VM"
|
||||||
packer build -var "capture_name_prefix=$ResourcesNamePrefix" `
|
packer build -var "capture_name_prefix=$ResourcesNamePrefix" `
|
||||||
-var "client_id=$ClientId" `
|
-var "client_id=$ClientId" `
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
param(
|
param(
|
||||||
[ValidateSet('Windows2019-Azure','Windows2016-Azure','ubuntu1604','ubuntu1804')]
|
|
||||||
[String] [Parameter (Mandatory=$true)] $Image,
|
[String] [Parameter (Mandatory=$true)] $Image,
|
||||||
[String] [Parameter (Mandatory=$true)] $ResourcesNamePrefix,
|
[String] [Parameter (Mandatory=$true)] $ResourcesNamePrefix,
|
||||||
[String] [Parameter (Mandatory=$true)] $ClientId,
|
[String] [Parameter (Mandatory=$true)] $ClientId,
|
||||||
|
|||||||
Reference in New Issue
Block a user