如果我有这两个文件包含以下数据集:
旧文件:
"CanonicalName","LastSet"
"CONTOSO.com/NA/US/OU1/Users/Active/Test User","2019-07-02 14:14:44"
"CONTOSO.com/NA/US/OU1/Users/Active/User One","2019-07-02 14:14:44"
"CONTOSO.com/NA/US/OU2/Users/Active/User Two","2018-09-02 05:53:35"
"CONTOSO.com/OC/AU/OU3/Users/User Three","2017-06-23 14:20:07"
临时文件:
"CanonicalName","LastSet"
"CONTOSO.com/NA/US/OU1/Users/Active/User One","2019-07-02 14:14:44"
"CONTOSO.com/NA/US/OU2/Users/Active/User Two","2018-09-02 05:53:35"
"CONTOSO.com/OC/AU/OU3/Users/User Three","2017-06-23 14:20:07"
返回:
InputObject SideIndicator
----------- -------------
@{CanonicalName=CONTOSO.com/OC/AU/OU3/Users/User Three; LastSet=2017-06-23 14:20:07} <=
我希望它在执行以下代码时返回带有“<=”的 TEST 用户:
Compare-Object -ReferenceObject (import-csv $oldfile) -DifferenceObject (import-csv $tempfile)
为什么?如何获得所需的输出?不同的对象。