1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<#
.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]
}}
|
本文转自bard_zhang51CTO博客,原文链接:http://blog.51cto.com/timefiles/1847366 ,如需转载请自行联系原作者