List all devices, partitions and volumes in Powershell

后端 未结 9 817
时光取名叫无心
时光取名叫无心 2021-01-30 19:53

I have multiple volumes (as nearly everybody nowadays): on Windows they end up specified as C:, D: and so on. How do I list these all like on a Unix machine with \"ls /mnt/\" wi

9条回答
  •  遥遥无期
    2021-01-30 20:50

    Though this isn't 'powershell' specific... you can easily list the drives and partitions using diskpart, list volume

    PS C:\Dev> diskpart
    
    Microsoft DiskPart version 6.1.7601
    Copyright (C) 1999-2008 Microsoft Corporation.
    On computer: Box
    
    DISKPART> list volume
    
    Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
    ----------  ---  -----------  -----  ----------  -------  ---------  --------
    Volume 0     D                       DVD-ROM         0 B  No Media
    Volume 1         C = System   NTFS   Partition    100 MB  Healthy    System
    Volume 2     G   C = Box      NTFS   Partition    244 GB  Healthy    Boot
    Volume 3     H   D = Data     NTFS   Partition    687 GB  Healthy
    Volume 4     E   System Rese  NTFS   Partition    100 MB  Healthy
    

提交回复
热议问题