你如何在PowerShell中recursion列出目录?
我试过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
当shell被终止时,在Windows上产生的Ruby进程死亡
在GAC(CMD或PowerShell)中注册DLL
在PowerShell中使用特定的configuration文件启动Chrome
search文件并将path存储在variables中
通过networking复制batch file和vbs脚本文件的文件和文件夹
脚本来查找给定的string,并replace给定目录中的所有文件
Windows 10 Powershell调用WebRequest“Windows安全警告”
如何更改环境variablespowershell并启动应用程序
比较两个列表,find列表中的名字,而不是使用PowerShell列出两个名字
在PowerShell中, dir是Get-ChildItem cmdlet的别名。
使用它与-Recurse参数递归列出子项目:
Get-ChildItem -Recurse
如果您只需要目录而不是文件,请使用-Directory开关:
Get-ChildItem -Recurse -Directory
在3.0版中为文件系统提供程序引入了-Directory开关。
对于PowerShell 2.0,请在PSIsContainer属性上进行PSIsContainer :
Get-ChildItem -Recurse |Where-Object {$_.PSIsContainer}
(PowerShell别名支持参数解析,所以在上面的所有例子中, Get-ChildItem可以用dir替换)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。