diff --git a/Project/MainWindow.ps1 b/Project/MainWindow.ps1 index 0ab581f..3811611 100644 --- a/Project/MainWindow.ps1 +++ b/Project/MainWindow.ps1 @@ -317,7 +317,12 @@ $formMainWindowControlHeading.Content = $Global:AutopilotOOBE.Title #================================================ $Global:GetRegCurrentVersion = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -$SubTitleProductName = ($Global:GetRegCurrentVersion).ProductName +# This will no longer be accurate with Windows 11 by design as described here: +# https://learn.microsoft.com/en-us/answers/questions/555857/windows-11-product-name-in-registry?page=2 +# $SubTitleProductName = ($Global:GetRegCurrentVersion).ProductName + +# Instead we will pull the name directly from WMI with Get-CimInstance and remove Microsoft from the beginning of the string +$SubTitleProductName = ((Get-CimInstance Win32_OperatingSystem).Caption).Replace('Microsoft ','') if ($Global:GetRegCurrentVersion.DisplayVersion -gt 0) { $SubTitleDisplayVersion = ($Global:GetRegCurrentVersion).DisplayVersion @@ -790,4 +795,4 @@ Hide-PowershellWindow ########################## $jobCleanup.Flag = $false #Stop Cleaning Jobs $jobCleanup.PowerShell.Runspace.Close() #Close the runspace -$jobCleanup.PowerShell.Dispose() #Remove the runspace from memory \ No newline at end of file +$jobCleanup.PowerShell.Dispose() #Remove the runspace from memory