FriendsOfMDT / PSD

PowerShell Deployment
MIT License
471 stars 72 forks source link

Wipe all Disks in Pre-PSD wipes USB-Sticks #66

Closed ASlowTurtle closed 1 year ago

ASlowTurtle commented 1 year ago

I love the new Pre-PSD menu (and the release in general). But I noticed that wiping all disks also wipes the USB stick (from which I booted). PSDResources\Prestart\PSDPrestartMenu.ps1 `         '2' { Clear-Host Write-Host "Cleaning all disks"

Get-Disk | Clear-Disk -RemoveData -RemoveOEM -Confirm:$false -Verbose

            #Get-PhysicalDisk | Reset-PhysicalDisk -Verbose

Using diskpart due to issues with Clear-Disk

            # Borrowed (with pride) code snippet from David Segura
            $Disks = Get-Disk
            foreach ($Disk in $Disks){

$null = @" select disk $($Disk.number) clean exit "@ | diskpart.exe } Changing line 75 to $Disks = Get-Disk | Where-Object "bustype" -ne "usb"` should prevent that.

GeoSimos commented 1 year ago

We're in the process of fixing this, thank you very much for the spotting of the issue and the excellent info provided!

arwidmark commented 1 year ago

Issues has been fixed in the latest update, thank you for the heads-up.