Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
farag2 committed Jul 2, 2023
1 parent 65e68cd commit fd55424
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 23 deletions.
27 changes: 16 additions & 11 deletions src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ public static string GetString(uint strId)
# Detect the OS build version
switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber)
{
{$_ -lt 22000}
{
Write-Warning -Message $Localization.UnsupportedOSBuild

Start-Process -FilePath "https://t.me/sophia_chat"
Start-Process -FilePath "https://discord.gg/sSryhaEv79"
Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements"

exit
}
{$_ -eq 22000}
{
if (Test-Path -Path "$env:LOCALAPPDATA\PCHealthCheck\PCHealthCheck.exe")
Expand Down Expand Up @@ -277,7 +287,7 @@ public static string GetString(uint strId)

exit
}
{($_ -ge 22621) -and ($_ -le 22624)}
{$_ -eq 22621}
{
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1928)
{
Expand Down Expand Up @@ -313,16 +323,6 @@ public static string GetString(uint strId)
exit
}
}
{$_ -lt 22000}
{
Write-Warning -Message $Localization.UnsupportedOSBuild

Start-Process -FilePath "https://t.me/sophia_chat"
Start-Process -FilePath "https://discord.gg/sSryhaEv79"
Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements"

exit
}
}

# Check the language mode
Expand Down Expand Up @@ -2297,6 +2297,11 @@ function BrowsingHistory
$Show
)

if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1928)
{
return
}

switch ($PSCmdlet.ParameterSetName)
{
"Hide"
Expand Down
29 changes: 17 additions & 12 deletions src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ public static string GetString(uint strId)
# Detect the OS build version
switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber)
{
{$_ -lt 22000}
{
Write-Warning -Message $Localization.UnsupportedOSBuild

Start-Process -FilePath "https://t.me/sophia_chat"
Start-Process -FilePath "https://discord.gg/sSryhaEv79"
Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements"

exit
}
{$_ -eq 22000}
{
if (Test-Path -Path "$env:LOCALAPPDATA\PCHealthCheck\PCHealthCheck.exe")
Expand Down Expand Up @@ -273,7 +283,7 @@ public static string GetString(uint strId)

exit
}
{($_ -ge 22621) -and ($_ -le 22624)}
{$_ -eq 22621}
{
if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1928)
{
Expand Down Expand Up @@ -309,16 +319,6 @@ public static string GetString(uint strId)
exit
}
}
{$_ -lt 22000}
{
Write-Warning -Message $Localization.UnsupportedOSBuild

Start-Process -FilePath "https://t.me/sophia_chat"
Start-Process -FilePath "https://discord.gg/sSryhaEv79"
Start-Process -FilePath "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements"

exit
}
}

# Check the language mode
Expand Down Expand Up @@ -2301,6 +2301,11 @@ function BrowsingHistory
$Show
)

if ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -lt 1928)
{
return
}

switch ($PSCmdlet.ParameterSetName)
{
"Hide"
Expand Down Expand Up @@ -10906,7 +10911,7 @@ function UninstallUWPApps
$AppxPackages += Get-AppxPackage -Name Disney.37853FC22B2CE -AllUsers:$AllUsers
}

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

foreach ($AppxPackage in $AppxPackages)
{
Expand Down

0 comments on commit fd55424

Please sign in to comment.