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 d453260e1..39ca0853e 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 @@ -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 @@ -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 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 8bc566ad0..36adaabf9 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 @@ -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 @@ -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 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 4a8135833..71ce7946e 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 @@ -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 @@ -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