-
-
Save MVKozlov/33e6d440fc6a99af6cc1dd776cda2ae5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS D:\> $Indicator = @{ '=>' = 'Right'; '<=' = 'Left'; '==' = 'Same' } | |
>>> $Indicator | |
Name Value | |
---- ----- | |
== Same | |
<= Left | |
=> Right | |
PS D:\> $c1 = import-csv d:\c1 -delim "`t" | |
>>> $c1 | |
Name Value | |
---- ----- | |
a1 v1 | |
a2 v2 | |
a3 v3 | |
PS D:\> $c2 = import-csv d:\c2 -delim "`t" | |
>>> $c2 | |
Name Value | |
---- ----- | |
a1 vb2 | |
b2 vb2 | |
b3 v3 | |
PS D:\> Compare-Object -IncludeEqual $c1 $c2 -Property Name | Select-Object Name, Value, @{Label = 'SideIndicator'; Expression = { $Indicator[$_.SideIndicator] } } | |
>>> | |
Name Value SideIndicator | |
---- ----- ------------- | |
a1 Same | |
b2 Right | |
b3 Right | |
a2 Left | |
a3 Left | |
PS D:\> Compare-Object -IncludeEqual $c1 $c2 -Property Name -PassThru | Select-Object *, @{Label = 'Side'; Expression = { $Indicator[$_.SideIndicator] } } | |
>>> | |
Name Value SideIndicator Side | |
---- ----- ------------- ---- | |
a1 v1 == Same | |
b2 vb2 => Right | |
b3 v3 => Right | |
a2 v2 <= Left | |
a3 v3 <= Left |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment