PowerShell比较文本文件的两个方法
2017-02-05
28
需求:比较两个文本文件,不相等时输出行号和列号,和开始不相等的字符。方法一:Compare-Object利用PowerShell命令Compare-Object,非常值得学习。复制代码 代码如下:function Compare-Files{param($file1,$file2,[switch]$IncludeEqual)$content1 = Get-Content $file1$content2 = Get-Content $file2$compar...