diff --git a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 index 2756fdd2..9ba4eb17 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 @@ -405,8 +405,8 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); $Parameters = @{ Uri = "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update_v6.txt" UseBasicParsing = $true - Verbose = $true - } + Verbose = $true + } $update_v6 = (Invoke-WebRequest @Parameters).Content $IPArray += $extra, $extra_v6, $spy, $spy_v6, $update, $update_v6 @@ -807,8 +807,7 @@ public extern static string BrandingFormatString(string sFormat); $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] # Windows 10 $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " - - # 24H2 + # e.g. 24H2 $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) @@ -862,7 +861,17 @@ public extern static string BrandingFormatString(string sFormat); {$_ -ne 19045} { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.UnsupportedOSBuild -f [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%")) + + # Windows 10 Pro + $Windows_Long = [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") + $Windows_Long_First_Item = $Windows_Long.split(" ")[0] + $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] + # Windows 11 + $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " + # e.g. 24H2 + $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion + + Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://t.me/sophia_chat" -Verbose @@ -1088,7 +1097,7 @@ public extern static string BrandingFormatString(string sFormat); if ($Warning) { # Get the name of a preset (e.g Sophia.ps1) regardless it was named - # $_.File has no EndsWith() method + Write-Information -MessageData "" -InformationAction Continue [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_.EndsWith(".ps1")} Write-Verbose -Message ($Localization.CustomizationWarning -f "`"$PresetName`"") -Verbose diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 index 8624e3fa..cbe176ec 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 @@ -405,8 +405,8 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); $Parameters = @{ Uri = "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update_v6.txt" UseBasicParsing = $true - Verbose = $true - } + Verbose = $true + } $update_v6 = (Invoke-WebRequest @Parameters).Content $IPArray += $extra, $extra_v6, $spy, $spy_v6, $update, $update_v6 @@ -769,8 +769,7 @@ public extern static string BrandingFormatString(string sFormat); $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] # Windows 10 $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " - - # 24H2 + # e.g. 24H2 $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) @@ -824,7 +823,17 @@ public extern static string BrandingFormatString(string sFormat); {$_ -ne 17763} { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.UnsupportedOSBuild -f [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%")) + + # Windows 10 Pro + $Windows_Long = [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") + $Windows_Long_First_Item = $Windows_Long.split(" ")[0] + $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] + # Windows 11 + $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " + # e.g. 24H2 + $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion + + Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://t.me/sophia_chat" -Verbose diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 index 6c00c10d..3e5c96db 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 @@ -405,8 +405,8 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); $Parameters = @{ Uri = "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update_v6.txt" UseBasicParsing = $true - Verbose = $true - } + Verbose = $true + } $update_v6 = (Invoke-WebRequest @Parameters).Content $IPArray += $extra, $extra_v6, $spy, $spy_v6, $update, $update_v6 @@ -769,8 +769,7 @@ public extern static string BrandingFormatString(string sFormat); $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] # Windows 10 $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " - - # 24H2 + # e.g. 24H2 $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) @@ -824,7 +823,17 @@ public extern static string BrandingFormatString(string sFormat); {$_ -ne 19044} { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.UnsupportedOSBuild -f [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%")) + + # Windows 10 Pro + $Windows_Long = [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") + $Windows_Long_First_Item = $Windows_Long.split(" ")[0] + $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] + # Windows 11 + $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " + # e.g. 24H2 + $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion + + Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://t.me/sophia_chat" -Verbose diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 index c74f9d71..6ea691cd 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 @@ -418,8 +418,8 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); $Parameters = @{ Uri = "https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/update_v6.txt" UseBasicParsing = $true - Verbose = $true - } + Verbose = $true + } $update_v6 = (Invoke-WebRequest @Parameters).Content $IPArray += $extra, $extra_v6, $spy, $spy_v6, $update, $update_v6 @@ -839,8 +839,7 @@ public extern static string BrandingFormatString(string sFormat); $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] # Windows 10 $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " - - # 24H2 + # e.g. 24H2 $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) @@ -894,7 +893,17 @@ public extern static string BrandingFormatString(string sFormat); {$_ -ne 19045} { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.UnsupportedOSBuild -f [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%")) + + # Windows 10 Pro + $Windows_Long = [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") + $Windows_Long_First_Item = $Windows_Long.split(" ")[0] + $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] + # Windows 11 + $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " + # e.g. 24H2 + $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion + + Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://t.me/sophia_chat" -Verbose diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index 34b0cbd3..b4d3c1fc 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -925,7 +925,7 @@ public extern static string BrandingFormatString(string sFormat); $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] # Windows 11 $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " - # 24H2 + # e.g. 24H2 $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) @@ -979,7 +979,17 @@ public extern static string BrandingFormatString(string sFormat); {$_ -lt 26100} { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.UnsupportedOSBuild -f [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%")) + + # Windows 11 Pro + $Windows_Long = [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") + $Windows_Long_First_Item = $Windows_Long.split(" ")[0] + $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] + # Windows 11 + $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " + # e.g. 24H2 + $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion + + Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://t.me/sophia_chat" -Verbose @@ -1099,7 +1109,7 @@ public extern static string BrandingFormatString(string sFormat); if ($Warning) { # Get the name of a preset (e.g Sophia.ps1) regardless it was named - # $_.File has no EndsWith() method + Write-Information -MessageData "" -InformationAction Continue [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_.EndsWith(".ps1")} Write-Verbose -Message ($Localization.CustomizationWarning -f "`"$PresetName`"") -Verbose @@ -1307,6 +1317,7 @@ function DiagTrackService if (-not ("WinAPI.GetStrings" -as [type])) { # Get the name of a preset (e.g Sophia.ps1) regardless it was named + # $_.File has no EndsWith() method $PresetName = Split-Path -Path (((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_.EndsWith(".ps1")}) -Leaf Write-Information -MessageData "" -InformationAction Continue diff --git a/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 index 5ba8ab67..5c3869cd 100644 --- a/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 @@ -929,7 +929,7 @@ public extern static string BrandingFormatString(string sFormat); # Windows 11 $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " - # 24H2 + # e.g. 24H2 $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) diff --git a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 index febc7c35..153851d7 100644 --- a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 @@ -960,8 +960,7 @@ public extern static string BrandingFormatString(string sFormat); $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] # Windows 11 $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " - - # 24H2 + # e.g. 24H2 $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) @@ -1015,7 +1014,17 @@ public extern static string BrandingFormatString(string sFormat); {$_ -lt 26100} { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.UnsupportedOSBuild -f [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%")) + + # Windows 11 Pro + $Windows_Long = [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") + $Windows_Long_First_Item = $Windows_Long.split(" ")[0] + $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] + # Windows 11 + $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " + # e.g. 24H2 + $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion + + Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://t.me/sophia_chat" -Verbose @@ -1135,7 +1144,6 @@ public extern static string BrandingFormatString(string sFormat); if ($Warning) { # Get the name of a preset (e.g Sophia.ps1) regardless it was named - # $_.File has no EndsWith() method Write-Information -MessageData "" -InformationAction Continue [string]$PresetName = ((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_.EndsWith(".ps1")} Write-Verbose -Message ($Localization.CustomizationWarning -f "`"$PresetName`"") -Verbose diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 index 4f116173..38705ab1 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 @@ -913,7 +913,7 @@ public extern static string BrandingFormatString(string sFormat); # Windows 11 $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " - # 24H2 + # e.g. 24H2 $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) @@ -967,7 +967,17 @@ public extern static string BrandingFormatString(string sFormat); {$_ -ne 26100} { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.UnsupportedOSBuild -f [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%")) + + # Windows 11 Pro + $Windows_Long = [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") + $Windows_Long_First_Item = $Windows_Long.split(" ")[0] + $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] + # Windows 11 + $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " + # e.g. 24H2 + $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion + + Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://t.me/sophia_chat" -Verbose diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 index d5018603..5e563d56 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 @@ -957,8 +957,7 @@ public extern static string BrandingFormatString(string sFormat); $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] # Windows 11 $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " - - # 24H2 + # e.g. 24H2 $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) @@ -1012,7 +1011,17 @@ public extern static string BrandingFormatString(string sFormat); {$_ -lt 26100} { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.UnsupportedOSBuild -f [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%")) + + # Windows 11 Pro + $Windows_Long = [WinAPI.Winbrand]::BrandingFormatString("%WINDOWS_LONG%") + $Windows_Long_First_Item = $Windows_Long.split(" ")[0] + $Windows_Long_Second_Item = $Windows_Long.split(" ")[1] + # Windows 11 + $Windows_Long = ($Windows_Long_First_Item, $Windows_Long_Second_Item) -join " " + # e.g. 24H2 + $DisplayVersion = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name DisplayVersion + + Write-Warning -Message ($Localization.UnsupportedOSBuild -f $Windows_Long, $DisplayVersion) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://t.me/sophia_chat" -Verbose