Comparing folders and content with PowerShell

后端 未结 6 1468
广开言路
广开言路 2020-12-02 17:43

I have two different folders with xml files. One folder (folder2) contains updated and new xml files compared to the other (folder1). I need to know which files in folder2 a

6条回答
  •  心在旅途
    2020-12-02 18:24

    Do this:

    compare (Get-ChildItem D:\MyFolder\NewFolder) (Get-ChildItem \\RemoteServer\MyFolder\NewFolder)
    

    And even recursively:

    compare (Get-ChildItem -r D:\MyFolder\NewFolder) (Get-ChildItem -r \\RemoteServer\MyFolder\NewFolder)
    

    and is even hard to forget :)

提交回复
热议问题