SQL SERVER – Powershell – Get a List of Fixed Hard Drive and Free Space on Server
Posted
by pinaldave
on SQL Authority
See other posts from SQL Authority
or by pinaldave
Published on Sun, 27 Nov 2011 01:30:46 +0000
Indexed on
2011/11/27
9:56 UTC
Read the original article
Hit count: 637
Pinal Dave
|PostADay
|sql
|SQL Authority
|SQL Query
|SQL Scripts
|SQL Server
|SQL Stored Procedure
|SQL Tips and Tricks
|T SQL
|Technology
|powershell
Earlier I have written this article SQL SERVER – Get a List of Fixed Hard Drive and Free Space on Server. I recently received excellent comment by MVP Ravikanth. He demonstrated that how the same can be done using Powershell. It is very sweet and quick solution.
Here is the powershell script. Run the same in your powershell windows.
Get-WmiObject -Class Win32_LogicalDisk | Select -Property DeviceID, @{Name=’FreeSpaceMB’;Expression={$_.FreeSpace/1MB} } | Format-Table -AutoSize
Well, I ran this script in my powershell window, it gave me following result – very accurately and easily.
Thanks Ravikanth one more time for excellent tip.
Reference: Pinal Dave (http://blog.SQLAuthority.com)
Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Stored Procedure, SQL Tips and Tricks, T SQL, Technology Tagged: Powershell
© SQL Authority or respective owner