|
48 | 48 | .PARAMETER MutuallyExclusive
|
49 | 49 | Contexts that are mutually exclusive with each other.
|
50 | 50 | E.g.: Where the user has to select between one of several environments.
|
| 51 | +
|
| 52 | + .PARAMETER Components |
| 53 | + What extra components to include in the new context |
51 | 54 |
|
52 | 55 | .PARAMETER DefaultAccessRules
|
53 | 56 | A new Active Directory environment comes with more deployed security delegations than defined in the schema.
|
|
117 | 120 |
|
118 | 121 | [string[]]
|
119 | 122 | $MutuallyExclusive = @(),
|
| 123 | + |
| 124 | + [ValidateSet( |
| 125 | + 'DefaultAccessRules', |
| 126 | + 'DefaultSchemaAttributes', |
| 127 | + 'ExchangeDefaultAccessRules', |
| 128 | + 'ExchangeSplitPermissionAccessRules' |
| 129 | + )] |
| 130 | + [string[]] |
| 131 | + $Components, |
120 | 132 |
|
121 | 133 | [switch]
|
122 | 134 | $DefaultAccessRules,
|
|
170 | 182 | Copy-Item -Path "$script:ModuleRoot\internal\data\context\*" -Destination "$($contextVersionFolder.FullName)\" -Recurse
|
171 | 183 |
|
172 | 184 | #region Default Access Rules
|
173 |
| - if ($DefaultAccessRules){ |
| 185 | + if ($DefaultAccessRules -or $Components -contains 'DefaultAccessRules'){ |
174 | 186 | Copy-Item -Path "$script:ModuleRoot\internal\data\domainDefaults\accessRules\*.json" -Destination "$($contextVersionFolder.FullName)\domain\accessrules\"
|
175 | 187 | Copy-Item -Path "$script:ModuleRoot\internal\data\domainDefaults\objectCategories\*.psd1" -Destination "$($contextVersionFolder.FullName)\domain\objectcategories\"
|
176 | 188 | Copy-Item -Path "$script:ModuleRoot\internal\data\domainDefaults\gppermissions\*.json" -Destination "$($contextVersionFolder.FullName)\domain\gppermissions\"
|
|
180 | 192 | }
|
181 | 193 | #endregion Default Access Rules
|
182 | 194 |
|
| 195 | + #region Default Schema Attributes |
| 196 | + if ($Components -contains 'DefaultSchemaAttributes') { |
| 197 | + Copy-Item -Path "$script:ModuleRoot\internal\data\forestDefaults\schema\*.json" -Destination "$($contextVersionFolder.FullName)\forest\schema\" |
| 198 | + } |
| 199 | + #endregion Default Schema Attributes |
| 200 | + |
183 | 201 | #region Exchange Access Rules
|
184 |
| - switch ($ExchangeAccessRules) { |
185 |
| - 'Default' { |
186 |
| - Copy-Item -Path "$script:ModuleRoot\internal\data\exchangeDefaults\accessRules\*.json" -Destination "$($contextVersionFolder.FullName)\domain\accessrules\" |
187 |
| - } |
188 |
| - 'SplitPermission' { |
189 |
| - Copy-Item -Path "$script:ModuleRoot\internal\data\exchangeSPDefaults\accessRules\*.json" -Destination "$($contextVersionFolder.FullName)\domain\accessrules\" |
190 |
| - } |
| 202 | + if ($ExchangeAccessRules -eq 'SplitPermission' -or $Components -contains 'ExchangeSplitPermissionAccessRules') { |
| 203 | + Copy-Item -Path "$script:ModuleRoot\internal\data\exchangeSPDefaults\accessRules\*.json" -Destination "$($contextVersionFolder.FullName)\domain\accessrules\" |
| 204 | + } |
| 205 | + elseif ($ExchangeAccessRules -eq 'Default' -or $Components -contains 'ExchangeDefaultAccessRules') { |
| 206 | + Copy-Item -Path "$script:ModuleRoot\internal\data\exchangeDefaults\accessRules\*.json" -Destination "$($contextVersionFolder.FullName)\domain\accessrules\" |
191 | 207 | }
|
192 | 208 | #endregion Exchange Access Rules
|
193 | 209 |
|
|
0 commit comments