@@ -185,24 +185,18 @@ public override AstVisitAction VisitCommand(CommandAst commandAst)
185
185
private void GenerateDiagnosticRecords ( )
186
186
{
187
187
bool referenceCompatibility = curCmdletCompatibilityMap [ reference ] ;
188
- bool requestedCompatibility = ruleParameters . compatibility . Any ( x => curCmdletCompatibilityMap [ x ] ) ;
189
188
190
- // If the command is present in reference platform but not in any of the given platforms.
191
- // Or if the command is not present in reference platform but present in any of the given platforms
189
+ // If the command is present in reference platform but not in any of the target platforms.
190
+ // Or if the command is not present in reference platform but present in any of the target platforms
192
191
// then declare it as an incompatible cmdlet.
193
- // If it is present neither in reference platform nor any given platforms, then it is probably a
192
+ // If it is present neither in reference platform nor any target platforms, then it is probably a
194
193
// non-builtin command and hence do not declare it as an incompatible cmdlet.
195
194
// Since we do not check for aliases, the XOR-ing will also make sure that aliases are not flagged
196
- // as they will be found neither in reference platform nor in given platforms
197
- if ( ! ( referenceCompatibility ^ requestedCompatibility ) )
198
- {
199
- return ;
200
- }
201
-
195
+ // as they will be found neither in reference platform nor in target platforms
202
196
foreach ( var platform in ruleParameters . compatibility )
203
197
{
204
198
var curCmdletCompat = curCmdletCompatibilityMap [ platform ] ;
205
- if ( ! curCmdletCompat )
199
+ if ( ! curCmdletCompat && referenceCompatibility )
206
200
{
207
201
var cmdletName = curCmdletAst . GetCommandName ( ) ;
208
202
var platformInfo = platformSpecMap [ platform ] ;
0 commit comments