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".

所以基本上我的问题是,文件夹的掩码是什么?

解决方法

我傻了

文件夹的掩码将只是:*

因此, *.* => *

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...