Thursday, June 9, 2016

Check disk space through powershell

$credget-Credential
$computersget-Content c:\neeraj\complist.txt
 
foreach ( $item in $computers) { 
get-WmiObject win32_logicaldisk -Credential $cred -ComputerName $item -Filter "Drivetype=3"  |  
ft SystemName,DeviceID,VolumeName,@{Label="Total SIze";Expression={$_.Size / 1gb -as [int] }},@{Label="Free Size";Expression={$_.freespace / 1gb -as [int] }} -autosize 
} 

No comments:

Post a Comment

Thanks for showing interest in tech-jockey.

Content of this blog has been moved to GITHUB

Looking at current trends and to make my content more reachable to people, I am moving all the content of my blog https://tech-jockey.blogsp...