0

I have used the below code to compare the two files excel1 and excel2 and write the difference out to another file, but the output format is way different than expected.

Clear-Host

$File1 = Get-Content C:\Work\Compare\Excel1.xlsx
$File2 = Get-Content C:\Work\Compare\Excel2.xlsx

$Location = C:\Work\Compare\diff.csv

compare-object (get-content $File1) (get-content $File2) | format-list | Out-File $Location

Excel1 enter image description here

Excel2 enter image description here

Output get-content : Illegal characters in path. At C:\Users\lchandrakanthredd\Desktop\Untitled2.ps1:8 char:38

  • compare-object (get-content $File1) (get-content $File2) | format-lis

Appreciate your answers to the above question

Thanks In Advance

chandu
  • 83
  • 1
  • 11

0 Answers0