Description
UseCompatibleCommands and UseCompatibleTypes create a "union" profile for comparison of target profiles to a base standard. This allows us to use simple heuristic to determine whether a PowerShell AST represents something that is platform-specific (we see if the command or type is available in any platform, and if not ignore it as user-defined).
The problem here is that to create good warnings we have to have a good baseline union profile. Meaning we need to be judicious about how we make the profile. But since we could get it wrong, I created an informal mechanism for including things into the union profile. We use all the profiles in the "profile directory" and nothing else:
This means that:
- Including only one target, you still get good warnings, because it's compared against all the other profiles we ship by default
- Using a target not in the profile directory, that won't be included in the union comparison
- You can configure a different profile directory to get rid of comparisons to PowerShells you don't care about
This works but it's a bit subtle. I think we should move to:
- All targets are in the union by default
- Targets in the profile directory are in the union by default
- Targets can be excluded from the union in a configuration setting, by name or path
- The profile directory automatic union inclusion can be turned off by default