From 807456de86edb7075e791205ff6b5bf4021802a7 Mon Sep 17 00:00:00 2001 From: w0 <33212583+w0@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:57:58 -0500 Subject: [PATCH] removed unused variable. more format. --- FFUDevelopment/USBImagingToolCreator.ps1 | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/FFUDevelopment/USBImagingToolCreator.ps1 b/FFUDevelopment/USBImagingToolCreator.ps1 index d390896..c5c28ab 100644 --- a/FFUDevelopment/USBImagingToolCreator.ps1 +++ b/FFUDevelopment/USBImagingToolCreator.ps1 @@ -16,8 +16,7 @@ function Get-USBDrive { $USBDrives = (Get-WmiObject -Class Win32_DiskDrive -Filter "MediaType='Removable Media'") If ($USBDrives -and ($null -eq $USBDrives.count)) { $USBDrivesCount = 1 - } - else { + } else { $USBDrivesCount = $USBDrives.Count } WriteLog "Found $USBDrivesCount USB drives" @@ -64,8 +63,7 @@ function Build-DeploymentUSB { if ($DrivesCount -gt 1) { writelog "Get file system information for all drives" $Partitions = Get-Partition | Get-Volume - } - else { + } else { writelog "Get file system information for drive number $DiskNumber" $Partitions = Get-Partition -DiskNumber $DriveNumber | Get-Volume } @@ -129,8 +127,7 @@ function Build-DeploymentUSB { } if ($DrivesCount -gt 1) { Writelog "Building $DrivesCount drives concurrently...Please be patient..." - } - else { + } else { Writelog "Building the imaging tool on $model...Please be patient..." } Get-Job | Wait-Job | Out-Null @@ -192,12 +189,11 @@ function New-DeploymentUSB { WriteLog "Closing all Diskpart windows to prevent drive lock errors" Stop-Process -Name diskpart -ErrorAction SilentlyContinue $Selection = $Drivelist[$DriveSelected].Number - $totalSteps = 5 + if ($Selection -eq $last) { Read-Host -Prompt "ALL DRIVES SELECTED! WILL ERASE ALL CURRENTLY CONNECTED USB DRIVES!! Press ENTER to continue" Build-DeploymentUSB -Drives $Drives - } - else { + } else { Read-Host -Prompt "Drive number $Selection was selected. Press ENTER to continue" Build-DeploymentUSB -Drives $Drives[$DriveSelected] }