Skip to content

"Property" output is similar as if "Passthru" is specified #4568

@gwpelletier

Description

@gwpelletier

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.

Metadata

Metadata

Assignees

Labels

area-utilityArea - Microsoft.PowerShell.Utility module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions