标签:powershell 获取磁盘空间
<#
.Name
get-diskinfo
.Example
PS C:\sicrping> .\diskinfo.ps1 -computername localhost
DeviceID FreeDB SizeDB
-------- ------ ------
C: 7 48
D: 37 63
E: 693 931
#>
[cmdletbinding()]
param(
[string]$computername=‘‘
)
Get-WmiObject -ComputerName $computername -class win32_logicaldisk | select DeviceID,`
@{n=‘FreeDB‘;e={$_.freespace / 1gb -as [int]}},`
@{n=‘SizeDB‘;e={$_.size / 1gb -as [int]}}本文出自 “汜水流年_” 博客,请务必保留此出处http://timefiles.blog.51cto.com/8475652/1847366
标签:powershell 获取磁盘空间
原文地址:http://timefiles.blog.51cto.com/8475652/1847366