The results in post #1264 did not display:
a) all drives (missing recovery partition)
OK, I do NOT
have a Recovery Partition
so I couldn't test that.
I am just trying to help, like I do with testing, to get the information you want, and in a neat format.
Ideally the commands/results would display:
a) all drives (whether they do or do not have designated drive letters)
b) drive size in GB
c) free space in GB
d) % free
I have adapted my Command to align the output for Size (GB)
, Used (GB)
, and FreeSpace
. . .
Code:
PowerShell "Get-Volume | Select DriveLetter, FileSystemLabel, FileSystemType, DriveType, HealthStatus, OperationalStatus, @{Name='Toyal (GB)';Expression={[math]::Round($_.Size/1GB,2,00).ToString('#.00').PadLeft(9,' ')}}, @{Name='Used (GB)';Expression={[math]::Round(($_.Size-$_.SizeRemaining)/1GB,2,00).ToString('#.00').PadLeft(9,' ')}}, @{Name='Free (GB)';Expression={[math]::Round($_.SizeRemaining/1GB,2,00).ToString('#.00').PadLeft(9,' ')}} | Sort-Object -Property DriveLetter | Format-Table -Autosize | Out-String -Width 1000"
DriveLetter FileSystemLabel FileSystemType DriveType HealthStatus OperationalStatus Toyal (GB) Used (GB) Free (GB)
----------- --------------- -------------- --------- ------------ ----------------- ---------- --------- ---------
System Reserved NTFS Fixed Healthy OK .57 .45 .12
C Win_10 NTFS Fixed Healthy OK 30.03 14.58 15.45
D Data NTFS Fixed Healthy OK 17.79 10.89 6.89
E Unknown CD-ROM Healthy Unknown .00 .00 .00
S System_Image NTFS Fixed Healthy OK 7.00 .96 6.04
I will now try and get the Percentage at the end for you.
DONE . . .
Code:
PowerShell "Get-Volume | Select DriveLetter, FileSystemLabel, FileSystemType, DriveType, HealthStatus, OperationalStatus, @{Name='Total (GB)';Expression={[math]::Round($_.Size/1GB,2,00).ToString('#.00').PadLeft(9,' ')}}, @{Name='Used (GB)';Expression={[math]::Round(($_.Size-$_.SizeRemaining)/1GB,2,00).ToString('#.00').PadLeft(9,' ')}}, @{Name='Free (GB)';Expression={[math]::Round($_.SizeRemaining/1GB,2,00).ToString('#.00').PadLeft(9,' ')}}, @{Name='Free %';Expression={[math]::Round(($_.SizeRemaining/$_.Size)*100,2)}} | Sort-Object -Property DriveLetter | Format-Table -Autosize | Out-String -Width 1000"
DriveLetter FileSystemLabel FileSystemType DriveType HealthStatus OperationalStatus Total (GB) Used (GB) Free (GB) Free %
----------- --------------- -------------- --------- ------------ ----------------- ---------- --------- --------- ------
System Reserved NTFS Fixed Healthy OK .57 .45 .12 20.96
C Win_10 NTFS Fixed Healthy OK 30.03 14.58 15.45 51.45
D Data NTFS Fixed Healthy OK 17.79 10.89 6.89 38.75
E Unknown CD-ROM Healthy Unknown .00 .00 .00
S System_Image NTFS Fixed Healthy OK 7.00 .96 6.04 86.34