PowerShell Genie

Storage module: setup and commands

Module 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Inspect physical disks, partitions, volumes and Storage Spaces with Get-Disk and Get-Volume before any destructive initialization or formatting step.

Getting it

Built into Windows 8 and Windows Server 2012 onward.

Examples

1PS> Get-Volume
Show reference output
1 DriveLetter FileSystemLabel FileSystem DriveType HealthStatus SizeRemaining Size
2 ----------- --------------- ---------- --------- ------------ ------------- ----
3 C Windows NTFS Fixed Healthy 184.3 GB 476.1 GB
1PS> Get-PhysicalDisk
Show reference output
1 FriendlyName MediaType CanPool OperationalStatus HealthStatus Size
2 ------------ --------- ------- ----------------- ------------ ----
3 NVMe Samsung SSD SSD False OK Healthy 953.9 GB

What it is for

Use it for capacity and health reporting where a volume view serves better than a drive letter view. Get-PhysicalDisk is the place to look when a disk is predicting failure while the volume above it still reports itself healthy.

Typical tasks

  • Report free space for every volume
  • Find volumes with no drive letter
  • Check physical disk health and operational status
  • Inspect the partition layout on a disk
  • Identify unallocated capacity on a disk
  • Review the state of a Storage Spaces pool

Check the installed version

1PS> Get-Module -ListAvailable Storage | Select-Object Name, Version, Path
2PS> Get-Command -Module Storage

Compare the module path and version with the session used by your scheduled task or automation account. Use it for capacity and health reporting where a volume view serves better than a drive letter view. Get-PhysicalDisk is the place to look when a disk is predicting failure while the volume above it still reports itself healthy.

Primary documentation

Files, storage and hashes documentation

Continue
Genie guideStorage module: setup and commands

Inspect physical disks, partitions, volumes and Storage Spaces with Get-Disk and Get-Volume before any destructive initialization or formatting step.