microsoft / PSRule

Validate infrastructure as code (IaC) and objects using PowerShell rules.
https://microsoft.github.io/PSRule/v2/
MIT License
395 stars 49 forks source link

Improve cross module dependency support #248

Closed BernieWhite closed 4 years ago

BernieWhite commented 5 years ago

Currently it is possible for a rule to depend on a rule in a completely different module. i.e.

Rule 'Rule1' -DependsOn 'OtherModule\Rule2' {
}

However for Rule2 to be discovered the module OtherModule must be included in the list of modules provided to Invoke-PSRule.

For example: Invoke-PSRule -Module Module1,OtherModule.

This is not ideal, because it also will execute any rules in OtherModule by default unless -Name Rule1 is also added to the Invoke-PSRule call.

Ideally, a cross module reference should automatically include the specific rule referenced as a dependency.

This is also related to #170.

BernieWhite commented 5 years ago

Required for #210.