如何解决PowerShell Copy-Item 包含文件夹的掩码是什么?
a
|
- c
|
- abc.txt
b
copy-item -Force -Recurse -Verbose "a\*" -Destination "b" -Include "*.*" -Exclude "Web.config" -Container
但是当我使用这些掩码时,文件夹不会被复制
当我删除 -Include "*.*"
copy-item -Force -Recurse -Verbose "a\*" -Destination "b" -Exclude "Web.config" -Container
然后一切正常,这是日志:
VERBOSE: Performing the operation "copy Directory" on target "Item: C:\Users\\Documents\test\a\c Destination:
C:\Users\\Documents\test\b\c".
VERBOSE: Performing the operation "Create Directory" on target "Destination: C:\Users\\Documents\test\b\c".
VERBOSE: Performing the operation "copy File" on target "Item: C:\Users\\Documents\test\a\c\dsd.txt
Destination: C:\Users\\Documents\test\b\c\dsd.txt".
所以基本上我的问题是,文件夹的掩码是什么?
解决方法
我傻了
文件夹的掩码将只是:*
因此,
*.*
=> *
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。