我有两个 System.Data.DataSet 对象,我希望使用 Compare-Object Cmdlet 进行比较。我希望输出一个数据集,其中包含原始数据集的列,但只有差异和一个附加列,其中包含在 Compare-Object cmdlet 中计算的 SideIndicator 值。
假设我有这两个 CSV:
#C:\test.csv
"firstName","lastName"
"Bruce","Wayne"
"Clark","Kent"
#C:\test2.csv
"firstName","lastName"
"Peter","Parker"
"Clark","Kent"
"Jean","Grey"
我想使用以下结果:
compare-object (Get-Content C:\test.csv) (Get-Content C:\test2.csv)
填充格式如下的数据集:
#desiredResult
"firstName","lastName","SideIndicator"
"Peter","Parker","=>"
"Jean","Grey","=>"
"Bruce","Wayne","<="
谢谢,扎克