-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-utilityArea - Microsoft.PowerShell.Utility moduleArea - Microsoft.PowerShell.Utility module
Description
Not sure if this is a bug or expected behavior.
When I use Property to handle comparison, the output is similar as if "Passthru" was specified, but just shows the properties I'm comparing against
Source object:
PS C:\WINDOWS\system32> $MonitorSetup_Current
BitsPerPixel : 32
Bounds : {X=0,Y=0,Width=3440,Height=1440}
DeviceName : \\.\DISPLAY1
Primary : True
WorkingArea : {X=0,Y=0,Width=0,Height=0}
BitsPerPixel : 32
Bounds : {X=3440,Y=-307,Width=1200,Height=1920}
DeviceName : \\.\DISPLAY2
Primary : False
WorkingArea : {X=0,Y=0,Width=0,Height=0}
Comparison object:
PS C:\WINDOWS\system32> $MonitorSetup_New
BitsPerPixel : 32
Bounds : {X=0,Y=0,Width=3440,Height=1440}
DeviceName : \\.\DISPLAY1
Primary : True
WorkingArea : {X=0,Y=0,Width=3440,Height=1400}
Property output (comparing DeviceName,Bounds,Primary)
PS C:\WINDOWS\system32> Compare-Object -ReferenceObject $MonitorSetup_Current -DifferenceObject $MonitorSetup_New -Property DeviceName,Bounds,Primary
DeviceName Bounds Primary SideIndicator
---------- ------ ------- -------------
\\.\DISPLAY2 {X=3440,Y=-307,Width=1200,Height=1920} False <=
Full output, no parameters:
PS C:\WINDOWS\system32> Compare-Object -ReferenceObject $MonitorSetup_Current -DifferenceObject $MonitorSetup_New
InputObject SideIndicator
----------- -------------
Screen[Bounds={X=0,Y=0,Width=3440,Height=1440} WorkingArea={X=0,Y=0,Width=3440,Height=1400} Primary=True DeviceName=\\.\DISPLAY1 =>
Screen[Bounds={X=0,Y=0,Width=3440,Height=1440} WorkingArea={X=0,Y=0,Width=0,Height=0} Primary=True DeviceName=\\.\DISPLAY1 <=
Screen[Bounds={X=3440,Y=-307,Width=1200,Height=1920} WorkingArea={X=0,Y=0,Width=0,Height=0} Primary=False DeviceName=\\.\DISPLAY2 <=
PSVersionTable output:
PS C:\WINDOWS\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.17134.858
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17134.858
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: a7615306-98e3-0b79-ac87-58bb191b4349
- Version Independent ID: 85f1e969-8216-bed4-2204-409cbd9befd4
- Content: Compare-Object (Microsoft.PowerShell.Utility)
- Content Source: reference/6/Microsoft.PowerShell.Utility/Compare-Object.md
- Product: powershell
- Technology: powershell-cmdlets
- GitHub Login: @JamesWTruher
- Microsoft Alias: jimtru
Metadata
Metadata
Assignees
Labels
area-utilityArea - Microsoft.PowerShell.Utility moduleArea - Microsoft.PowerShell.Utility module