A Compare-Object Bug (modification of post by view diff)
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1069"></script>download | new post
Demo for unexpected output of Compare-Object
- # I want do demonstrate a Compare-object bug
- # Bernd Kriszio - http://pauerschell.blogspot.com/
- 1, 2, 3, 4, 5 > .\textfile_a.txt
- 1, 2, 4, 5, 6 > .\textfile_b.txt
- cat .\textfile_a.txt
- cat .\textfile_b.txt
- compare-object (gc .\textfile_a.txt) (gc .\textfile_b.txt) -inc
- <#yields
- InputObject SideIndicator
- ----------- -------------
- 1 ==
- 2 ==
- 4 ==
- 5 ==
- 6 =>
- 3 <=
- I think it has to be
- InputObject SideIndicator
- ----------- -------------
- 1 ==
- 2 ==
- 3 <=
- 4 ==
- 5 ==
- 6 =>
- #>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository