|
@ -577,10 +577,24 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
exit |
|
|
exit |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Detect Windows build version |
|
|
|
|
|
if ((Get-WindowsEdition -Online).Edition -ne "EnterpriseS") |
|
|
|
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
Write-Warning -Message $Localization.UnsupportedOSBuild |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
|
|
|
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose |
|
|
|
|
|
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose |
|
|
|
|
|
Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements" -Verbose |
|
|
|
|
|
|
|
|
|
|
|
exit |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
# Detect Windows build version |
|
|
# Detect Windows build version |
|
|
switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber) |
|
|
switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber) |
|
|
{ |
|
|
{ |
|
|
{$_ -lt 22631} |
|
|
{$_ -ne 26100} |
|
|
{ |
|
|
{ |
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message $Localization.UnsupportedOSBuild |
|
|
Write-Warning -Message $Localization.UnsupportedOSBuild |
|
@ -601,7 +615,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
|
|
|
|
|
|
exit |
|
|
exit |
|
|
} |
|
|
} |
|
|
"22631" |
|
|
"26100" |
|
|
{ |
|
|
{ |
|
|
# Check whether the current module version is the latest one |
|
|
# Check whether the current module version is the latest one |
|
|
try |
|
|
try |
|
@ -626,7 +640,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
Verbose = $true |
|
|
Verbose = $true |
|
|
UseBasicParsing = $true |
|
|
UseBasicParsing = $true |
|
|
} |
|
|
} |
|
|
$LatestSupportedBuild = (Invoke-RestMethod @Parameters).Windows_11 |
|
|
$LatestSupportedBuild = (Invoke-RestMethod @Parameters).Windows_11_LTSC_2024 |
|
|
} |
|
|
} |
|
|
catch [System.Net.WebException] |
|
|
catch [System.Net.WebException] |
|
|
{ |
|
|
{ |
|
@ -1333,11 +1347,8 @@ function ErrorReporting |
|
|
{ |
|
|
{ |
|
|
"Disable" |
|
|
"Disable" |
|
|
{ |
|
|
{ |
|
|
if ((Get-WindowsEdition -Online).Edition -notmatch "Core") |
|
|
Get-ScheduledTask -TaskName QueueReporting -ErrorAction Ignore | Disable-ScheduledTask |
|
|
{ |
|
|
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Windows Error Reporting" -Name Disabled -PropertyType DWord -Value 1 -Force |
|
|
Get-ScheduledTask -TaskName QueueReporting -ErrorAction Ignore | Disable-ScheduledTask |
|
|
|
|
|
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Windows Error Reporting" -Name Disabled -PropertyType DWord -Value 1 -Force |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Get-Service -Name WerSvc | Stop-Service -Force |
|
|
Get-Service -Name WerSvc | Stop-Service -Force |
|
|
Get-Service -Name WerSvc | Set-Service -StartupType Disabled |
|
|
Get-Service -Name WerSvc | Set-Service -StartupType Disabled |
|
|