windows – 递归列出powershell中的目录
发布时间:2020-12-14 04:36:10 所属栏目:Windows 来源:网络整理
导读:参见英文答案 How do I get only directories using Get-ChildItem?15个 你如何在Powershell中递归列出目录? 我试过dir / S但没有运气: PS C:Userssnowcrash dir /Sdir : Cannot find path 'C:S' because it does not exist.At line:1 char:1+ dir /S+
参见英文答案 >
How do I get only directories using Get-ChildItem?15个
你如何在Powershell中递归列出目录? 我试过dir / S但没有运气: PS C:Userssnowcrash> dir /S dir : Cannot find path 'C:S' because it does not exist. At line:1 char:1 + dir /S + ~~~~~~ + CategoryInfo : ObjectNotFound: (C:S:String) [Get-ChildItem],ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
在PowerShell中,dir是Get-ChildItem cmdlet的别名.
与-Recurse参数一起使用它以递归方式列出子项: Get-ChildItem -Recurse 如果您只想要目录而不是文件,请使用-Directory开关: Get-ChildItem -Recurse -Directory -Directory开关是为3.0版中的文件系统提供程序引入的. 对于PowerShell 2.0,过滤PSIsContainer属性: Get-ChildItem -Recurse |Where-Object {$_.PSIsContainer} (PowerShell别名支持参数解析,因此在上面的所有示例中,Get-ChildItem都可以替换为dir) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-server-2003 – 从死Windows域控制器中获取FSMO角色
- windows – 为什么我的WINVER 4 .exe在W98SE下运行?
- windows – 如何获取和打印环境变量的值?
- windows – 获取线程信息/环境块(TIB / TEB)的官方方式
- windows-phone-7.1 – 将照片保存到课堂
- Windows – HP Proliant服务器 – 用于系统运行状况的WMI查
- 如何在Windows上的DNS中找到LDAP服务器?
- VBox共享文件夹中的符号链接的Windows问题
- .net – WPF,Windows窗体或其他?
- msbuild – 为什么我的.wpp.targets文件不能应用在我的构建