Powershell 获取磁盘信息

$aryComputers="loopback","localhost"

Set-Variable -Name intDriveType -Value 3 -Option Constant

foreach($strComputer in $aryComputers)

{

    "Hard drives on :"+$strComputer

     Get-WmiObject -Class win32_logicaldisk -ComputerName $strComputer | 

        Where-Object{$_.drivetype -eq $intDriveType}

}


你可能感兴趣的:(localhost,信息)