1 # Copyright (c) Microsoft Corporation.
2 # SPDX-License-Identifier: MIT
7 Prints total and free disk space for each disk on the system
10 Function Format-Size {
31 $Size = [int]($Size / 1024)
35 Get-CimInstance -ClassName Win32_LogicalDisk | Format-Table -Property @{Label="Disk"; Expression={ $_.DeviceID }},@{Label="Label"; Expression={ $_.VolumeName }},@{Label="Size"; Expression={ Format-Size($_.Size) }},@{Label="Free Space"; Expression={ Format-Size($_.FreeSpace) }}