Created
May 16, 2013 20:34
-
-
Save janegilring/5594894 to your computer and use it in GitHub Desktop.
Entry from the 2013 Scripting Games Beginner Event 3, reviewed at blog.powershell.no
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-CimInstance -ClassName Win32_LogicalDisk -ComputerName localhost -Filter 'DriveType = 3' -Property DeviceID,Size,FreeSpace | | |
Select-Object -Property @{Name="Drive";Expression={$_.DeviceID}}, | |
@{Name="Size(GB)";Expression={"{0:N2}" -f ($_.Size/1GB)}}, | |
@{Name="FreeSpace(MB)";Expression={"{0:N2}" -f ($_.FreeSpace/1MB)}} | | |
ConvertTo-Html -Property Drive,'Size(GB)','FreeSpace(MB)' ` | |
-Head "<title>Disk Free Space Report</title><h2>Local Fixed Disk Report</h2>" ` | |
-PostContent "<hr>",(Get-Date) | | |
Out-File C:\temp\LocalDrivesOnServer.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment