1
-
2
1
. (Join-Path $PSScriptRoot common.ps1)
3
2
Install-Module - Name powershell- yaml - RequiredVersion 0.4 .1 - Force - Scope CurrentUser
4
- $ymlfiles = Get-ChildItem $RepoRoot | Where-Object {$_ -like ' *.yml' }
5
- $affectedRepos = @ ()
3
+ $ymlfiles = Get-ChildItem $RepoRoot - recurse | Where-Object {$_ -like ' *.yml' }
4
+ $affectedRepos = [ System.Collections.ArrayList ]::new ()
6
5
7
6
foreach ($file in $ymlfiles )
8
7
{
@@ -21,7 +20,7 @@ foreach ($file in $ymlfiles)
21
20
if (-not ($repo.Contains (" ref" )))
22
21
{
23
22
$errorMessage = " File: ${file} , Repository: ${repoName} ."
24
- $affectedRepos.Add ($errorMessage )
23
+ [ void ] $affectedRepos.Add ($errorMessage )
25
24
}
26
25
}
27
26
}
@@ -30,14 +29,14 @@ foreach ($file in $ymlfiles)
30
29
31
30
if ($affectedRepos.Count -gt 0 )
32
31
{
33
- Write-Error " Ref not found in the following Repository Resources."
32
+ Write-Output " Ref not found in the following Repository Resources."
34
33
foreach ($errorMessage in $affectedRepos )
35
34
{
36
- Write-Information $errorMessage
35
+ Write-Output " `t $errorMessage "
37
36
}
38
- Write-Information " Please ensure you add a Ref: when using repository resources"
39
- Write-Information " More Info at https://aka.ms/azsdk/engsys/tools-versioning"
37
+ Write-Output " Please ensure you add a Ref: when using repository resources"
38
+ Write-Output " More Info at https://aka.ms/azsdk/engsys/tools-versioning"
40
39
exit 1
41
40
}
42
41
43
- Write-Information " All repository resources in yaml files reference a valid tag"
42
+ Write-Output " All repository resources in yaml files reference a valid tag"
0 commit comments