Skip to content

Get-DiskToUse listing main hard drive as an option #51

@Wobblagated

Description

@Wobblagated

image

The Get-DiskToUse function is listing my main hard drive as an option. After digging in as to why, my hard drive bustype is set to RAID. The function only filters out SATA and NVMe. The line below should be changed.
//From
$diskList = Get-Disk | Where-Object { $_.Bustype -notin @('SATA', 'NVMe') }
//To
$diskList = Get-Disk | Where-Object { $_.Bustype -notin @('SATA', 'NVMe', 'RAID') }
//Or for USB only
$diskList = Get-Disk | Where-Object -FilterScript {$_.Bustype -Eq "USB"}

Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions