Comparing folders and content with PowerShell

后端 未结 6 1451
广开言路
广开言路 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:26

    gci -path 'C:\Folder' -recurse |where{$_.PSIsContainer}

    -recurse will explore all subtrees below the root path given and the .PSIsContainer property is the one you want to test for to grab all folders only. You can use where{!$_.PSIsContainer} for just files.

提交回复
热议问题