Exclude folder from Recurse in Powershell

前端 未结 1 731
一个人的身影
一个人的身影 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)
提交回复
热议问题