From 83af4f05c1c21634520c970511e13f2a004b78db Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 6 Jul 2022 14:00:11 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 3568 (#2257) * Skip yml files for which parsing failed * Update eng/common/scripts/Verify-Resource-Ref.ps1 Co-authored-by: Chidozie Ononiwu Co-authored-by: Wes Haggard --- eng/common/scripts/Verify-Resource-Ref.ps1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/Verify-Resource-Ref.ps1 b/eng/common/scripts/Verify-Resource-Ref.ps1 index 2800b1833c..f806290e98 100644 --- a/eng/common/scripts/Verify-Resource-Ref.ps1 +++ b/eng/common/scripts/Verify-Resource-Ref.ps1 @@ -7,7 +7,16 @@ foreach ($file in $ymlfiles) { Write-Host "Verifying '${file}'" $ymlContent = Get-Content $file.FullName -Raw - $ymlObject = ConvertFrom-Yaml $ymlContent -Ordered + + try + { + $ymlObject = ConvertFrom-Yaml $ymlContent -Ordered + } + catch + { + Write-Host "Skipping $($file.FullName) because the file does not contain valid yml." + continue + } if ($ymlObject -and ($ymlObject.Contains("resources"))) {