Closed jeremyhagan closed 1 year ago
Have you tried to use the DSC DependsOn Parameter to set the sequence of execution for these resources? This might help.
Thanks for the suggestion Andi.
I'm not sure this would help. It would certainly be easier to insert a new rule in the middle of the DependsOn chain, but without specifying a Priority it would still get created with the lowest priority. Unless I am missing something.
You could, in your config, define a variable and increase its value on each rule. For example
EXOMailboxSettings 'abc'
{
...
}
**$i = 0**
EXOTransportRule 'RuleABC'
{
Priority = $i++
}
EXOTransportRule 'RuleGHI'
{
Priority = $i++
}
EXOTransportRule 'RuleDEF'
{
Priority = $i++
}
DSC config can still use classic PowerShell logic in them and the generated value is what gets stored in the compiled file.
You could, in your config, define a variable and increase its value on each rule. For example
EXOMailboxSettings 'abc' { ... } **$i = 0** EXOTransportRule 'RuleABC' { Priority = $i++ } EXOTransportRule 'RuleGHI' { Priority = $i++ } EXOTransportRule 'RuleDEF' { Priority = $i++ }
That's workable. Thanks Nik
Hi,
I'm cutting my teeth managing Transport Rules and other EXO config. Each time I create a new transport rule in the config I have to renumber everything (unless it is at the end). The only way out of this mess I can think of it to manage rule precedence outside of the DSC config. In this way new rules are always created at bottom and another script or manual process would be required to put the rule in it's correct place.
Does anyone have any more elegant ideas for this?