PowerShell/scripts/list-drives.ps1
2025-05-19 10:14:49 +02:00

25 lines
654 B
PowerShell
Executable File

<#
.SYNOPSIS
Lists all drives
.DESCRIPTION
This PowerShell script lists all local drives as a table.
.EXAMPLE
PS> ./list-drives.ps1
DriveLetter FriendlyName FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining Size
----------- ------------ -------------- --------- ------------ ----------------- ------------- ----
C SSD NTFS Fixed Healthy OK 449.65 GB 930.43 GB
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
Get-Volume
exit 0 # success
} catch {
"⚠️ Error: $($Error[0])"
exit 1
}