Skip to content

Commit d15c141

Browse files
committed
[PE Helper] Fix broken used volume letter check (why you stupid heap of junk?)
1 parent 208d6ac commit d15c141

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Helpers/extps1/PE_Helper/PE_Helper.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,19 +1275,22 @@ function Write-DiskConfiguration
12751275

12761276
# One of the three letters mentioned above may be already in use. Check these before assuming they're our targets.
12771277
# This is more the case when you boot the ISO with Ventoy
1278-
if ((Get-Volume | Where-Object { $_.DriveLetter -eq $espLetter }).Count -gt 0) {
1278+
# ---
1279+
# Preview 7 Edit -- powershell doesn't consider the count property until we select the object, therefore still causing the issue.
1280+
# Why, you stupid heap of C# junk?????
1281+
if ((Get-Volume | Where-Object { $_.DriveLetter -eq $espLetter } | Select-Object -ExpandProperty DriveLetter).Count -gt 0) {
12791282
Write-Host "The default letter for the EFI System Partition is already in use."
12801283
$usedLetters++
12811284
$espUsed = $true
12821285
}
12831286

1284-
if ((Get-Volume | Where-Object { $_.DriveLetter -eq $bootLetter }).Count -gt 0) {
1287+
if ((Get-Volume | Where-Object { $_.DriveLetter -eq $bootLetter } | Select-Object -ExpandProperty DriveLetter).Count -gt 0) {
12851288
Write-Host "The default letter for the boot partition is already in use."
12861289
$usedLetters++
12871290
$bootUsed = $true
12881291
}
12891292

1290-
if ((Get-Volume | Where-Object { $_.DriveLetter -eq $recoveryLetter }).Count -gt 0) {
1293+
if ((Get-Volume | Where-Object { $_.DriveLetter -eq $recoveryLetter } | Select-Object -ExpandProperty DriveLetter).Count -gt 0) {
12911294
Write-Host "The default letter for the Windows Recovery Environment partition is already in use."
12921295
$usedLetters++
12931296
$recoveryUsed = $true

0 commit comments

Comments
 (0)