mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Fix USB drive detection logic for empty arrays
Replaces null comparison with count check to properly handle empty arrays. The previous condition would incorrectly pass when the array exists but contains no elements, potentially causing the function to proceed without a valid USB drive.
This commit is contained in:
@@ -3494,7 +3494,7 @@ Function Get-USBDrive {
|
||||
}
|
||||
|
||||
# Check if any USB drives were found
|
||||
if ($null -eq $USBDrives) {
|
||||
if ($USBDrives.Count -eq 0) {
|
||||
WriteLog "No USB drive found. Exiting"
|
||||
Write-Error "No USB drive found. Exiting"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user