Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Project/MainWindow.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
$jobCleanup.PowerShell.Dispose() #Remove the runspace from memory