powershell - 如何为符号制作过滤器 - 在 PowerShell 中
问题描述
如何为符号制作过滤器 - 在 PowerShell 中
Get-ChildItem -Include *-*
如果我的文件或文件夹的名称类似于
测试1-DEV
Test2-测试
Test3-分期
解决方案
使用-Path
(默认参数):
Get-ChildItem -Path *-*
或者,如果您在子目录中搜索,请将该-Recurse
参数与-Include
.
来自Get-Help Get-ChildItem
:
-Include <String[]> Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as *.txt. Wildcards are permitted. The Include parameter is effective only when the command includes the Recurse parameter or the path leads to the contents of a directory, such as C:\Windows\*, where the wildcard character specifies the contents of the C:\Windows directory. Required? false Position? named Default value None Accept pipeline input? False Accept wildcard characters? false
推荐阅读
- amazon-web-services - 使用 Terraform 模块复制基础设施会为同名 IAM 策略引发错误
- excel - 在 Android Web 上使用 input type=file 选择文件:excel 文件错误地可供选择,并返回 PDF mime 类型
- mysql - MySQL:如何将范围的分区组合成最大可能的连续范围
- json - 从数组中提取元素
- python - 在python中使用tkinter在窗口中不显示文本
- python-3.x - 从输入的用户输入创建和打印字典内容
- javascript - JS - 在是/否选项更改时检查是否选择了所有“否”选项
- mysql - 如何加快条件MYSQL查询
- django - 通过知道模型名称来获取模型动态
- doctrine-orm - Doctrine DQL 随机行?