@@ -76,6 +76,7 @@ function Test-AdfCode {
7676
7777 Write-Host " === Validating other rules ..."
7878
79+ Write-Host " Checking duplicated names..."
7980 $adf.AllObjects ().Name | Sort-Object - Unique | ForEach-Object {
8081 $r = $adf.GetObjectsByFullName (" *." + $_ )
8182 if ($r.Count -gt 1 ) {
@@ -84,6 +85,7 @@ function Test-AdfCode {
8485 }
8586 }
8687
88+ Write-Host " Checking names of datasets, pipelines, dataflows..."
8789 $adf.LinkedServices + $adf.DataSets + $adf.Pipelines + $adf.DataFlows | ForEach-Object {
8890 [string ] $name = $_.Name
8991 if ($name.Contains (' -' )) {
@@ -92,12 +94,16 @@ function Test-AdfCode {
9294 }
9395 }
9496
95- if ($adf.Factories.Count -gt 0 -and (Get-Member - InputObject $adf.Factories [0 ].Body - name " properties" - Membertype " Properties" )) {
96- Get-Member - InputObject $adf.Factories [0 ].Body.properties.globalParameters - Membertype " NoteProperty" | ForEach-Object {
97- [string ] $name = $_.Name
98- if ($name.Contains (' -' )) {
99- Write-Warning " Dashes ('-') are not allowed in the names of global parameters ($name )."
100- $result.WarningCount += 1
97+ Write-Host " Checking: Global parameter names..."
98+ if ($adf.Factories.Count -gt 0 ) {
99+ $gparams = $adf.GlobalFactory.GlobalParameters
100+ if ($gparams ) {
101+ $gparams | ForEach-Object {
102+ [string ] $name = $_.Name
103+ if ($name.Contains (' -' )) {
104+ Write-Warning " Dashes ('-') are not allowed in the names of global parameters ($name )."
105+ $result.WarningCount += 1
106+ }
101107 }
102108 }
103109 }
@@ -118,6 +124,7 @@ function Test-AdfCode {
118124 $files | ForEach-Object {
119125 try {
120126 $FileName = $_.FullName
127+ Write-Host " Checking config file: $FileName ..."
121128 Update-PropertiesFromFile - adf $adf - stage $FileName - ErrorVariable err - ErrorAction ' Stop' - dryRun:$True
122129 }
123130 catch {
0 commit comments