Skip to content

Commit

Permalink
Fixed wrong check for Windows 11 LTSC
Browse files Browse the repository at this point in the history
  • Loading branch information
farag2 committed Oct 7, 2024
1 parent 0b87860 commit 806be66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
9 changes: 3 additions & 6 deletions src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
}

# Detect Windows build version
if ((Get-WindowsEdition -Online).Edition -notmatch "EnterpriseS")
if ((Get-WindowsEdition -Online).Edition -ne "EnterpriseS")
{
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.UnsupportedOSBuild
Expand Down Expand Up @@ -1344,11 +1344,8 @@ function ErrorReporting
{
"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 | Set-Service -StartupType Disabled
Expand Down
9 changes: 3 additions & 6 deletions src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
}

# Detect Windows build version
if ((Get-WindowsEdition -Online).Edition -notmatch "EnterpriseS")
if ((Get-WindowsEdition -Online).Edition -ne "EnterpriseS")
{
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.UnsupportedOSBuild
Expand Down Expand Up @@ -1344,11 +1344,8 @@ function ErrorReporting
{
"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 | Set-Service -StartupType Disabled
Expand Down
9 changes: 3 additions & 6 deletions src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
}

# Detect Windows build version
if ((Get-WindowsEdition -Online).Edition -notmatch "EnterpriseS")
if ((Get-WindowsEdition -Online).Edition -ne "EnterpriseS")
{
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.UnsupportedOSBuild
Expand Down Expand Up @@ -1347,11 +1347,8 @@ function ErrorReporting
{
"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 | Set-Service -StartupType Disabled
Expand Down

0 comments on commit 806be66

Please sign in to comment.