Merge pull request #262 from jrollmann/UI_2508

Update USBImagingToolCreator.ps1
This commit is contained in:
rbalsleyMSFT
2025-08-27 15:38:12 -07:00
committed by GitHub
+2 -1
View File
@@ -28,7 +28,7 @@ function Write-ProgressLog {
} }
Function Get-RemovableDrive { Function Get-RemovableDrive {
writelog "Get information for all removable drives" writelog "Get information for all removable drives"
$USBDrives = Get-WmiObject Win32_DiskDrive | Where-Object {$_.MediaType -eq "Removable media"} $USBDrives = Get-WmiObject Win32_DiskDrive | Where-Object {$_.MediaType -eq "Removable media" -or $_.MediaType -eq "External hard disk media"}
If($USBDrives -and ($null -eq $USBDrives.count)) { If($USBDrives -and ($null -eq $USBDrives.count)) {
$USBDrivesCount = 1 $USBDrivesCount = 1
} else { } else {
@@ -62,6 +62,7 @@ Function Build-DeploymentUSB{
$ScriptBlock = { $ScriptBlock = {
param($DriveNumber) param($DriveNumber)
Clear-Disk -Number $DriveNumber -RemoveData -RemoveOEM -Confirm:$false Clear-Disk -Number $DriveNumber -RemoveData -RemoveOEM -Confirm:$false
Initialize-Disk -Number $DriveNumber
$Disk = Get-Disk -Number $DriveNumber $Disk = Get-Disk -Number $DriveNumber
$PartitionStyle = $Disk.PartitionStyle $PartitionStyle = $Disk.PartitionStyle
if($PartitionStyle -ne 'MBR'){ if($PartitionStyle -ne 'MBR'){