File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,21 @@ Describe 'UnitTest-ModifiedPolicies' {
109
109
}
110
110
}
111
111
112
+ It " Check policy metadata name matches policy filename" {
113
+ $ModifiedAddedFiles | ForEach-Object {
114
+ $PolicyJson = Get-Content - Path $_ - Raw | ConvertFrom-Json
115
+ $PolicyFile = Split-Path $_ - Leaf
116
+ $PolicyMetadataName = $PolicyJson.name
117
+ $PolicyFileNoExt = [System.IO.Path ]::GetFileNameWithoutExtension($PolicyFile )
118
+ if ($PolicyFileNoExt.Contains (" AzureChinaCloud" ) -or $PolicyFileNoExt.Contains (" AzureUSGovernment" ))
119
+ {
120
+ $PolicyFileNoExt = $PolicyFileNoExt.Substring (0 , $PolicyFileNoExt.IndexOf (" ." ))
121
+ }
122
+ Write-Warning " $ ( $PolicyFileNoExt ) - This is the policy metadata name: $ ( $PolicyMetadataName ) "
123
+ $PolicyMetadataName | Should - Be $PolicyFileNoExt
124
+ }
125
+ }
126
+
112
127
}
113
128
114
129
Context " Validate policy parameters" {
You can’t perform that action at this time.
0 commit comments