用 Get-Volume 列出所有卷和剩余空间
一行 PowerShell,显示每个卷的盘符、卷标、文件系统和剩余空间。
在 PowerShell 中运行 `Get-Volume` 列出所有卷;配合 Format-Table 和 SizeRemaining 可生成剩余空间报表。
01命令
命令
$ Get-Volume | Sort-Object DriveLetter | Format-Table DriveLetter, FileSystemLabel, FileSystem, @{n='SizeGB';e={[math]::Round($_.Size/1GB,1)}}, @{n='FreeGB';e={[math]::Round($_.SizeRemaining/1GB,1)}} -AutoSize02作用说明
Get-Volume 走存储命令层,返回的是对象而不是 fsutil 或 dir 那种固定文本。Size 和 SizeRemaining 是原始字节数,所以在计算属性里除以 1GB 就能得到可读的表格。它是 `wmic logicaldisk` 老写法的现代替代,PowerShell 5.1 和 7 都可用。
03风险
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- Get-Volume (Storage)依据: Documents Get-Volume, which returns volume objects with DriveLetter, FileSystemLabel, FileSystem, Size and SizeRemaining properties.
最后验证: 2026-09-17 · 分类: 系统与设置