Get-LocalDisk

OSD 21.2.22+

This function easily lets you filter out the Local from the Removable disks. It is also a shortcut for the following command

Get-OSDDisk -BusTypeNot 'File Backed Virtual',MAX,'Microsoft Reserved',SD,USB,Virtual
pageGet-OSDDiskpageGet-USBDisk

Parameters

PS C:\> Get-Help Get-LocalDisk -Parameter *

-Number <UInt32>
    Specifies the disk number for which to get the associated Disk object
    Alias = Disk, DiskNumber

    Required?                    false
    Position?                    1
    Default value                0
    Accept pipeline input?       false
    Accept wildcard characters?  false


-BootFromDisk <Boolean>
    Returns Disk results based BootFromDisk property
    PS> Get-OSDDisk -BootFromDisk:$true
    PS> Get-OSDDisk -BootFromDisk:$false

    Required?                    false
    Position?                    2
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false


-IsBoot <Boolean>
    Returns Disk results based IsBoot property
    PS> Get-OSDDisk -IsBoot:$true
    PS> Get-OSDDisk -IsBoot:$false

    Required?                    false
    Position?                    3
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false


-IsReadOnly <Boolean>
    Returns Disk results based IsReadOnly property
    PS> Get-OSDDisk -IsReadOnly:$true
    PS> Get-OSDDisk -IsReadOnly:$false

    Required?                    false
    Position?                    4
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false


-IsSystem <Boolean>
    Returns Disk results based IsSystem property
    PS> Get-OSDDisk -IsSystem:$true
    PS> Get-OSDDisk -IsSystem:$false

    Required?                    false
    Position?                    5
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false


-BusType <String[]>
    Returns Disk results in BusType values
    Values = '1394','ATA','ATAPI','Fibre Channel','File Backed Virtual','iSCSI','MMC','MAX','Microsoft Reserved','NVMe','RAID','SAS','SATA','SCSI','SD','SSA','Storage Spaces','USB','Virtual'
    PS> Get-OSDDisk -BusType NVMe
    PS> Get-OSDDisk -BusType NVMe,SAS

    Required?                    false
    Position?                    6
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-BusTypeNot <String[]>
    Returns Disk results notin BusType values
    Values = '1394','ATA','ATAPI','Fibre Channel','File Backed Virtual','iSCSI','MMC','MAX','Microsoft Reserved','NVMe','RAID','SAS','SATA','SCSI','SD','SSA','Storage Spaces','USB','Virtual'
    PS> Get-OSDDisk -BusTypeNot USB
    PS> Get-OSDDisk -BusTypeNot USB,Virtual

    Required?                    false
    Position?                    7
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-MediaType <String[]>
    Returns Disk results in MediaType values
    Values = 'SSD','HDD','SCM','Unspecified'
    PS> Get-OSDDisk -MediaType SSD

    Required?                    false
    Position?                    8
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-MediaTypeNot <String[]>
    Returns Disk results notin MediaType values
    Values = 'SSD','HDD','SCM','Unspecified'
    PS> Get-OSDDisk -MediaTypeNot HDD

    Required?                    false
    Position?                    9
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-PartitionStyle <String[]>
    Returns Disk results in PartitionStyle values
    Values = 'GPT','MBR','RAW')
    PS> Get-OSDDisk -PartitionStyle GPT

    Required?                    false
    Position?                    10
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false


-PartitionStyleNot <String[]>
    Returns Disk results notin PartitionStyle values
    Values = 'GPT','MBR','RAW')
    PS> Get-OSDDisk -PartitionStyleNot RAW

    Required?                    false
    Position?                    11
    Default value
    Accept pipeline input?       false
    Accept wildcard characters?  false

Last updated