-
-
Notifications
You must be signed in to change notification settings - Fork 544
Expand file tree
/
Copy pathlist-drives.ps1
More file actions
executable file
·24 lines (22 loc) · 706 Bytes
/
list-drives.ps1
File metadata and controls
executable file
·24 lines (22 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<#
.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]) (script line $($_.InvocationInfo.ScriptLineNumber))"
exit 1
}