-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
Compare-Object only reports differences by default, requiring explicit opt-in for inclusion of equal objects via -IncludeEqual.
Therefore, the only meaningful behavior when you use -ExcludeDifferent is to default to -IncludeEqual.
Without that, as is currently the case, nothing is ever output, so it is currently effectively pointless to pass -ExcludeDifferent without also passing -IncludeEqual.
Steps to reproduce
Compare-Object 1,2 3, 1 -ExcludeDifferent -PassThru -IncludeEqual | Should -Be 1
# Currently produces NO output, because -IncludeEqual isn't implied.
Compare-Object 1,2 3, 1 -ExcludeDifferent -PassThru | Should -Be 1Expected behavior
Both tests should pass.
Actual behavior
The 2nd test fails, because -IncludeEqual is not implied.
Environment data
PowerShell Core 7.0.0-rc.2
vexx32 and scotthardwick
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module