From eff42e08235de1fcc2ad66b48cc8e3cacd063521 Mon Sep 17 00:00:00 2001 From: InvisibleUp Date: Fri, 25 Jun 2021 15:57:52 -0400 Subject: [PATCH] Fix GPT detection failure with long disk names When the disk name is long (in my case "SAMSUNG SSD SM841N 2.5 7mm 128GB" plus a whole serial number in the next column) and the terminal emulator is narrow, Powershell might not display the PartitionStyle column. This patch fixes that issue by selecting only the PartitionStyle column. --- WhyNotWin11.au3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WhyNotWin11.au3 b/WhyNotWin11.au3 index 9db2f7b8..efecd5e2 100644 --- a/WhyNotWin11.au3 +++ b/WhyNotWin11.au3 @@ -144,7 +144,7 @@ Func Main() GUICtrlSetData($hCheck[4][2], _GetCPUInfo(3) & " MHz") EndIf - RunWait("powershell -Command Get-Partition -DriveLetter C | Get-Disk | Out-File -FilePath " & $hFile, "", @SW_HIDE) + RunWait("powershell -Command Get-Partition -DriveLetter C | Get-Disk | Select-Object -Property PartitionStyle | Out-File -FilePath " & $hFile, "", @SW_HIDE) Select Case StringInStr(FileRead($hFile), "Error") GUICtrlSetData($hCheck[6][0], "?") @@ -303,4 +303,4 @@ Func _GetLatestRelease($sCurrent) Return _VersionCompare($aCombined[0][0], $sCurrent) -EndFunc \ No newline at end of file +EndFunc