下面的查询搜索PowerShell中文件的位置。是否有任何方法只返回目录而不是目录属性和文件名?
Get-ChildItem -Path C:\random\random -Filter nameofile -Recurse发布于 2014-12-17 17:09:33
我假设您只需要包含匹配文件的目录的名称:
Get-ChildItem -Path C:\random\random -Filter nameofile -Recurse | % { split-path $_.fullname } | sort -uniq发布于 2014-12-17 17:24:13
(Get-ChildItem -Path C:\random\random -Filter nameofile -Recurse).DirectoryNamehttps://stackoverflow.com/questions/27530857
复制相似问题