Skip to content

Commit fd55424

Browse files
committed
hotfix
1 parent 65e68cd commit fd55424

File tree

2 files changed

+33
-23
lines changed

2 files changed

+33
-23
lines changed

src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@ public static string GetString(uint strId)
180180
# Detect the OS build version
181181
switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber)
182182
{
183+
{$_ -lt 22000}
184+
{
185+
Write-Warning -Message $Localization.UnsupportedOSBuild
186+
187+
Start-Process -FilePath "https://t.me/sophia_chat"
188+
Start-Process -FilePath "https://discord.gg/sSryhaEv79"
189+
Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements"
190+
191+
exit
192+
}
183193
{$_ -eq 22000}
184194
{
185195
if (Test-Path -Path "$env:LOCALAPPDATA\PCHealthCheck\PCHealthCheck.exe")
@@ -277,7 +287,7 @@ public static string GetString(uint strId)
277287

278288
exit
279289
}
280-
{($_ -ge 22621) -and ($_ -le 22624)}
290+
{$_ -eq 22621}
281291
{
282292
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1928)
283293
{
@@ -313,16 +323,6 @@ public static string GetString(uint strId)
313323
exit
314324
}
315325
}
316-
{$_ -lt 22000}
317-
{
318-
Write-Warning -Message $Localization.UnsupportedOSBuild
319-
320-
Start-Process -FilePath "https://t.me/sophia_chat"
321-
Start-Process -FilePath "https://discord.gg/sSryhaEv79"
322-
Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements"
323-
324-
exit
325-
}
326326
}
327327

328328
# Check the language mode
@@ -2297,6 +2297,11 @@ function BrowsingHistory
22972297
$Show
22982298
)
22992299

2300+
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1928)
2301+
{
2302+
return
2303+
}
2304+
23002305
switch ($PSCmdlet.ParameterSetName)
23012306
{
23022307
"Hide"

src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ public static string GetString(uint strId)
176176
# Detect the OS build version
177177
switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber)
178178
{
179+
{$_ -lt 22000}
180+
{
181+
Write-Warning -Message $Localization.UnsupportedOSBuild
182+
183+
Start-Process -FilePath "https://t.me/sophia_chat"
184+
Start-Process -FilePath "https://discord.gg/sSryhaEv79"
185+
Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements"
186+
187+
exit
188+
}
179189
{$_ -eq 22000}
180190
{
181191
if (Test-Path -Path "$env:LOCALAPPDATA\PCHealthCheck\PCHealthCheck.exe")
@@ -273,7 +283,7 @@ public static string GetString(uint strId)
273283

274284
exit
275285
}
276-
{($_ -ge 22621) -and ($_ -le 22624)}
286+
{$_ -eq 22621}
277287
{
278288
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1928)
279289
{
@@ -309,16 +319,6 @@ public static string GetString(uint strId)
309319
exit
310320
}
311321
}
312-
{$_ -lt 22000}
313-
{
314-
Write-Warning -Message $Localization.UnsupportedOSBuild
315-
316-
Start-Process -FilePath "https://t.me/sophia_chat"
317-
Start-Process -FilePath "https://discord.gg/sSryhaEv79"
318-
Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements"
319-
320-
exit
321-
}
322322
}
323323

324324
# Check the language mode
@@ -2301,6 +2301,11 @@ function BrowsingHistory
23012301
$Show
23022302
)
23032303

2304+
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1928)
2305+
{
2306+
return
2307+
}
2308+
23042309
switch ($PSCmdlet.ParameterSetName)
23052310
{
23062311
"Hide"
@@ -10906,7 +10911,7 @@ function UninstallUWPApps
1090610911
$AppxPackages += Get-AppxPackage -Name Disney.37853FC22B2CE -AllUsers:$AllUsers
1090710912
}
1090810913

10909-
$PackagesIds = [Windows.Management.Deployment.PackageManager, Windows.Web, ContentType = WindowsRuntime]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
10914+
$PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
1091010915

1091110916
foreach ($AppxPackage in $AppxPackages)
1091210917
{

0 commit comments

Comments
 (0)