2010-02-01 58 views

回答

1

您可以使用比较-对象如下:

clear-host 
$strFile1 = get-Content "C:\config_files_1\web.config" 
$strFile2 = get-Content "C:\config_files_2\web.config" 
Compare-Object $strFile1 $strFile2 

欲了解更多信息,你可能有兴趣在检查出的以下文章:

+0

它可以与PowerShell v1.0一起使用吗? – 2010-02-01 08:31:54

+0

是的,我刚刚在版本1.0.0.0中试过。有用。 – 2010-02-01 08:45:38

+0

非常好... 谢谢。 – 2010-02-01 08:51:47

1

如果您想要进行语义比较,请看: https://github.com/CameronWills/FatAntelope 此工具将比较web.config f iles并从差异中生成web.config转换。它可以从命令行运行。

声明:我写了。

+0

你可以提供一些示例代码(对于PowerShell),也许一些截图? – 2015-11-07 17:47:46

相关问题