Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing -Property to Compare-Object #4

Open
DawidGrzejek opened this issue Mar 31, 2023 · 1 comment
Open

Passing -Property to Compare-Object #4

DawidGrzejek opened this issue Mar 31, 2023 · 1 comment

Comments

@DawidGrzejek
Copy link

DawidGrzejek commented Mar 31, 2023

Hey,

When passing properties on which objects should be compared actually no difference is made.

$props = @('SN','DN','CN')
Compare-Object $1st $2nd -Property $props -IncludeEqual | ft
Compare-Object $1st $2nd -IncludeEqual | ft

First and Second compare result in the same output

@God-damnit-all
Copy link

Hey,

When passing properties on which objects should be compared actually no difference is made.

$props = @('SN','DN','CN') Compare-Object $1st $2nd -Property $props -IncludeEqual | ft Compare-Object $1st $2nd -IncludeEqual | ft

First and Second compare result in the same output

It doesn't work properly on PowerShell 5.1, but even on that, it's not displaying the same result for me:

$1st = @{SN='foo'}
$2nd = @{SN='bar'}
$props = @('SN','DN','CN')
Compare-Object $1st $2nd -Property $props -IncludeEqual | ft
Compare-Object $1st $2nd -IncludeEqual | ft

PowerShell 5.1

SN DN CN SideIndicator
-- -- -- -------------
         ==

InputObject SideIndicator
----------- -------------
{SN}        ==

PowerShell 7.4

SN  DN CN SideIndicator
--  -- -- -------------
bar       =>
foo       <=

InputObject SideIndicator
----------- -------------
{[SN, foo]} ==

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants