1
1
Param (
2
2
3
- [Parameter (Mandatory = $false )]
3
+ [Parameter (Mandatory = $true )]
4
4
[string ] $DefinitionsRootFolder ,
5
5
6
6
[ValidateSet (" ALZ" , " AMBA" )]
@@ -15,11 +15,11 @@ Param(
15
15
if ($LibraryPath -eq " " ) {
16
16
if ($Tag ) {
17
17
git clone -- depth 1 -- branch $Tag https:// github.com / anwather/ Azure- Landing- Zones- Library.git .\temp
18
- $LibraryPath = " .\ temp"
18
+ $LibraryPath = " ./ temp"
19
19
}
20
20
else {
21
21
git clone -- depth 1 https:// github.com / anwather/ Azure- Landing- Zones- Library.git .\temp
22
- $LibraryPath = " .\ temp"
22
+ $LibraryPath = " ./ temp"
23
23
}
24
24
}
25
25
@@ -142,6 +142,7 @@ foreach ($file in Get-ChildItem -Path "$LibraryPath\platform\$($Type.ToLower())\
142
142
143
143
144
144
$baseTemplate = @ {
145
+ " `$ schema" = " https://raw.githubusercontent.com/Azure/enterprise-azure-policy-as-code/main/Schemas/policy-assignment-schema.json"
145
146
nodeName = " $ ( $archetypeContent.name ) /$ ( $fileContent.name ) "
146
147
assignment = @ {
147
148
name = $fileContent.Name
@@ -235,7 +236,7 @@ foreach ($file in Get-ChildItem -Path "$LibraryPath\platform\$($Type.ToLower())\
235
236
if (! (Test-Path $DefinitionsRootFolder \policyAssignments\$Type \$category )) {
236
237
New-Item - Path $DefinitionsRootFolder \policyAssignments\$Type \$category - ItemType Directory - Force - ErrorAction SilentlyContinue
237
238
}
238
- $baseTemplate | Select-Object nodeName, assignment, definitionEntry, definitionVersion, enforcementMode, parameters, nonComplianceMessages, scope | ConvertTo-Json - Depth 50 | Out-File - FilePath $DefinitionsRootFolder \policyAssignments\$Type \$category \$ ($fileContent.name ).json - Force
239
+ $baseTemplate | Select-Object " `$ schema " , nodeName, assignment, definitionEntry, definitionVersion, enforcementMode, parameters, nonComplianceMessages, scope | ConvertTo-Json - Depth 50 | Out-File - FilePath $DefinitionsRootFolder \policyAssignments\$Type \$category \$ ($fileContent.name ).json - Force
239
240
(Get-Content $DefinitionsRootFolder \policyAssignments\$Type \$category \$ ($fileContent.name ).json) -replace " \[\[" , " [" | Set-Content $DefinitionsRootFolder \policyAssignments\$Type \$category \$ ($fileContent.name ).json
240
241
if ($fileContent.name -eq " Deploy-Private-DNS-Zones" ) {
241
242
(Get-Content $DefinitionsRootFolder \policyAssignments\$Type \$category \$ ($fileContent.name ).json) -replace " \.ne\." , " .$dnsZoneRegion ." | Set-Content $DefinitionsRootFolder \policyAssignments\$Type \$category \$ ($fileContent.name ).json
@@ -245,7 +246,7 @@ foreach ($file in Get-ChildItem -Path "$LibraryPath\platform\$($Type.ToLower())\
245
246
246
247
}
247
248
248
- if ($LibraryPath -eq " .\ temp" ) {
249
- Remove-Item .\ temp - Recurse - Force - ErrorAction SilentlyContinue
249
+ if ($LibraryPath -eq " ./ temp" ) {
250
+ Remove-Item ./ temp - Recurse - Force - ErrorAction SilentlyContinue
250
251
}
251
252
0 commit comments