test.ps1 539 Bytes
Newer Older
Stefan Scherer's avatar
Stefan Scherer committed
1 2
$ErrorActionPreference = 'Stop'

Stefan Scherer's avatar
Stefan Scherer committed
3 4 5 6 7 8 9 10 11
"dummy" | Out-File path-to.vmx
$env:PACKER_AZURE_AD_TENANT_ID="dummy"
$env:PACKER_AZURE_SUBSCRIPTION_ID="dummy"
$env:PACKER_AZURE_OBJECT_ID="dummy"
$env:PACKER_AZURE_APP_ID="dummy"
$env:PACKER_AZURE_CLIENT_SECRET="dummy"
$env:PACKER_AZURE_RESOURCE_GROUP="dummy"
$env:PACKER_AZURE_STORAGE_ACCOUNT="dummy"

Stefan Scherer's avatar
Stefan Scherer committed
12 13 14 15
$files = @(Get-ChildItem *.json)

foreach ($file in $files) {
  Write-Host "`n`nValidate $file"
Stefan Scherer's avatar
Stefan Scherer committed
16 17 18 19 20
  packer.exe validate $file
  if (-not $?)
  {
     throw "Packer validate found errors in $file!"
  }
Stefan Scherer's avatar
Stefan Scherer committed
21
}