junjie 通过本文主要向大家介绍了powershell,windows powershell,powershell是什么,powershell下载,powershell怎么打开等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
快速找出两个文件夹中不同的部分,可以使用下面例子:
$list1 = Get-ChildItem c:\Windows\system32 | Sort-Object -Property Name
$list2 = Get-ChildItem \\server12\c$\windows\system32 | Sort-Object -Property Name
Compare-Object -ReferenceObject $list1 -DifferenceObject $list2 -Property Name |
Sort-Object -Property Name
</div>
首先,脚本得到两个不同列表变量,一个来自本地,一个来自远程电脑,接着Compare-Object将从中分析出两边的不同处。

