Exclude folder from Recurse in Powershell

前端 未结 1 732
一个人的身影
一个人的身影 2021-01-23 17:20

I\'ve written the following script to move all MP4 file in a particular folder to the Root folder, however I want the script to ignore one particular folder called \"Camera\". I

1条回答
  •  温柔的废话
    2021-01-23 18:06

    -exclude is to filter filename or extension I dont think you can use it to filter directories. You can try this :

    gci c:\root\*.mp4 -recurse |where {$_.fullname -notmatch "camera"}
    

    0 讨论(0)
提交回复
热议问题