1
2
3
4
5
6
7
8
9
10
11
12
13
|
#用户指定需要的盘符,格式如“c:\” $zonename = Read-Host ( "please input need check disk zone,For example [C:\]" )
CD $zonename
#A打头文件夹筛选扫描 Get-ChildItem | where { $_ .Name -match "^a" } | select fullname | Out-File a.txt
$file = Get-Content "a.txt"
foreach ( $a in $file )
{
Write-Host $a
}
#使用完后清除文件 del a.txt |
本文转自bard_zhang51CTO博客,原文链接: http://blog.51cto.com/timefiles/1754822,如需转载请自行联系原作者