dong5300 发表于 2018-9-2 08:58:37

PowerShell 列举磁盘文件

#用户指定需要的盘符,格式如“c:\”  
$zonename=Read-Host("please input need check disk zone,For example ")
  
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


页: [1]
查看完整版本: PowerShell 列举磁盘文件