Browse Source

Small code refactoring

master
Dmitry Nefedov 3 days ago
parent
commit
d88e29950f
  1. 3
      Download_Latest_Sophia.ps1
  2. 3
      Download_Sophia.ps1
  3. 2
      src/Sophia_Script_for_Windows_10/Localizations/pl-PL/Sophia.psd1
  4. 100
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  5. 2
      src/Sophia_Script_for_Windows_10/Sophia.ps1
  6. 4
      src/Sophia_Script_for_Windows_10_LTSC_2019/Functions.ps1
  7. 2
      src/Sophia_Script_for_Windows_10_LTSC_2019/Localizations/pl-PL/Sophia.psd1
  8. 2
      src/Sophia_Script_for_Windows_10_LTSC_2019/Manifest/Sophia.psd1
  9. 99
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  10. 6
      src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1
  11. 17
      src/Sophia_Script_for_Windows_10_LTSC_2021/Functions.ps1
  12. 2
      src/Sophia_Script_for_Windows_10_LTSC_2021/Localizations/pl-PL/Sophia.psd1
  13. 97
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  14. 2
      src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1
  15. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/de-DE/Sophia.psd1
  16. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/en-US/Sophia.psd1
  17. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/es-ES/Sophia.psd1
  18. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/fr-FR/Sophia.psd1
  19. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/hu-HU/Sophia.psd1
  20. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/it-IT/Sophia.psd1
  21. 3
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/pl-PL/Sophia.psd1
  22. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/pt-BR/Sophia.psd1
  23. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/ru-RU/Sophia.psd1
  24. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/tr-TR/Sophia.psd1
  25. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/uk-UA/Sophia.psd1
  26. 1
      src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/zh-CN/Sophia.psd1
  27. 113
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  28. 2
      src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1
  29. 4
      src/Sophia_Script_for_Windows_11/Localizations/fr-FR/Sophia.psd1
  30. 2
      src/Sophia_Script_for_Windows_11/Localizations/hu-HU/Sophia.psd1
  31. 2
      src/Sophia_Script_for_Windows_11/Localizations/tr-TR/Sophia.psd1
  32. 105
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  33. 2
      src/Sophia_Script_for_Windows_11/Sophia.ps1
  34. 2
      src/Sophia_Script_for_Windows_11_LTSC_2024/Localizations/fr-FR/Sophia.psd1
  35. 2
      src/Sophia_Script_for_Windows_11_LTSC_2024/Localizations/pl-PL/Sophia.psd1
  36. 97
      src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1
  37. 2
      src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1
  38. 1
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/de-DE/Sophia.psd1
  39. 1
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1
  40. 3
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/es-ES/Sophia.psd1
  41. 7
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/fr-FR/Sophia.psd1
  42. 3
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/hu-HU/Sophia.psd1
  43. 1
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/it-IT/Sophia.psd1
  44. 1
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pl-PL/Sophia.psd1
  45. 1
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pt-BR/Sophia.psd1
  46. 1
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/ru-RU/Sophia.psd1
  47. 3
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/tr-TR/Sophia.psd1
  48. 1
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/uk-UA/Sophia.psd1
  49. 1
      src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/zh-CN/Sophia.psd1
  50. 113
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1
  51. 2
      src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

3
Download_Latest_Sophia.ps1

@ -25,7 +25,8 @@ if ($CurrentUserName -ne $LoginUserName)
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
break pause
exit
} }
if ($Host.Version.Major -eq 5) if ($Host.Version.Major -eq 5)

3
Download_Sophia.ps1

@ -25,7 +25,8 @@ if ($CurrentUserName -ne $LoginUserName)
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
break pause
exit
} }
if ($Host.Version.Major -eq 5) if ($Host.Version.Major -eq 5)

2
src/Sophia_Script_for_Windows_10/Localizations/pl-PL/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Skrypt obsługuje tylko 64-bitowe systemy Windows. UnsupportedOSBitness = Skrypt obsługuje tylko 64-bitowe systemy Windows.
UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 22H2. Twój system operacyjny to {0}. UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 22H2. Twoim systemem operacyjnym jest {0}.
UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie. UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie.
UpdateWarning = Twoja wersja systemu Windows 10: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. UpdateWarning = Twoja wersja systemu Windows 10: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie.
UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka. UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka.

100
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -509,16 +509,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
exit exit
} }
# Checking whether WMI is corrupted # Check Microsoft Defender state
try if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore))
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -530,9 +524,21 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
} }
# Check Microsoft Defender state # Check Microsoft Defender state
if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore)) try
{
$productState = (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState
$DefenderState = ('0x{0:x}' -f $productState).Substring(3, 2)
# Defender is a currently used AV. Continue...
if ($DefenderState -notmatch "00|01")
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -567,7 +573,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
try try
{ {
$Script:DefenderMpPreferenceBroken = $false $Script:DefenderMpPreferenceBroken = $false
(Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess (Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess
} }
catch [Microsoft.Management.Infrastructure.CimException] catch [Microsoft.Management.Infrastructure.CimException]
{ {
@ -3270,7 +3276,7 @@ function QuickAccessRecentFiles
# Remove all policies in order to make changes visible in UI only if it's possible # Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
@ -6082,7 +6088,7 @@ function WindowsFeatures
[void]$Window.Close() [void]$Window.Close()
$SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose} $SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedFeatures | Enable-WindowsOptionalFeature -Online -NoRestart $SelectedFeatures | Enable-WindowsOptionalFeature -Online -All -NoRestart
} }
function Add-FeatureControl function Add-FeatureControl
@ -9608,7 +9614,7 @@ public static long MakeLong(uint left, uint right)
New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -Type DWord -Value 0 -Force New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -PropertyType DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -10568,7 +10574,7 @@ function RegistryBackup
{ {
"Enable" "Enable"
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -Type DWord -Value 1 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -PropertyType DWord -Value 1 -Force
} }
"Disable" "Disable"
{ {
@ -10799,12 +10805,12 @@ function RecentlyAddedApps
} }
New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DWORD -Value 1 Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DWORD -Value 1
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type CLEAR
} }
} }
} }
@ -12198,17 +12204,13 @@ function CleanupTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -12638,17 +12640,13 @@ function SoftwareDistributionTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -12956,17 +12954,13 @@ function TempTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -13128,7 +13122,8 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object -FilterScript {`$_
(-join ("`$env:SystemDrive\", '`$Windows.~WS')), (-join ("`$env:SystemDrive\", '`$Windows.~WS')),
"`$env:SystemDrive\ESD", "`$env:SystemDrive\ESD",
"`$env:SystemDrive\Intel", "`$env:SystemDrive\Intel",
"`$env:SystemDrive\PerfLogs" "`$env:SystemDrive\PerfLogs",
"`$env:SystemRoot\ServiceProfiles\NetworkService\AppData\Local\Temp"
) )
if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName) if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName)
@ -15265,23 +15260,16 @@ public static void PostMessage()
#endregion Other actions #endregion Other actions
#region Toast notifications #region Toast notifications
# Persist Sophia notifications to prevent to immediately disappear from Action Center
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia))
{
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowInActionCenter -PropertyType DWord -Value 1 -Force
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia)) if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia))
{ {
New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force

2
src/Sophia_Script_for_Windows_10/Sophia.ps1

@ -125,7 +125,7 @@ try
} }
catch [System.InvalidOperationException] catch [System.InvalidOperationException]
{ {
Write-Warning -Message $Localization.UnsupportedPowerShell Write-Warning -Message ($Localization.UnsupportedPowerShell -f $PSVersionTable.PSVersion.Major, $PSVersionTable.PSVersion.Minor)
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose

4
src/Sophia_Script_for_Windows_10_LTSC_2019/Functions.ps1

@ -2,7 +2,7 @@
.SYNOPSIS .SYNOPSIS
The TAB completion for functions and their arguments The TAB completion for functions and their arguments
Version: 5.10.2 Version: 5.10.3
Date: 06.02.2025 Date: 06.02.2025
Copyright (c) 20142025 Team Sophia Copyright (c) 20142025 Team Sophia
@ -49,7 +49,7 @@ function Sophia
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.10.2 | Made with $([System.Char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([System.Char]0x00A9) Team Sophia, 2014$([System.Char]0x2013)2025" $Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.10.3 | Made with $([System.Char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([System.Char]0x00A9) Team Sophia, 2014$([System.Char]0x2013)2025"
Remove-Module -Name Sophia -Force -ErrorAction Ignore Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

2
src/Sophia_Script_for_Windows_10_LTSC_2019/Localizations/pl-PL/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Skrypt obsługuje tylko 64-bitowe systemy Windows. UnsupportedOSBitness = Skrypt obsługuje tylko 64-bitowe systemy Windows.
UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 Enterprise LTSC 2019. Twój system operacyjny to {0}. UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 Enterprise LTSC 2019. Twoim systemem operacyjnym jest {0}.
UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie. UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie.
UpdateWarning = Twoja wersja systemu Windows 10: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. UpdateWarning = Twoja wersja systemu Windows 10: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie.
UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka. UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka.

2
src/Sophia_Script_for_Windows_10_LTSC_2019/Manifest/Sophia.psd1

@ -1,6 +1,6 @@
@{ @{
RootModule = '..\Module\Sophia.psm1' RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.10.2' ModuleVersion = '5.10.3'
GUID = 'a36a65ca-70f9-43df-856c-3048fc5e7f01' GUID = 'a36a65ca-70f9-43df-856c-3048fc5e7f01'
Author = 'Team Sophia' Author = 'Team Sophia'
Copyright = '(c) 2014—2025 Team Sophia. All rights reserved' Copyright = '(c) 2014—2025 Team Sophia. All rights reserved'

99
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -3,7 +3,7 @@
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
.VERSION .VERSION
5.10.2 5.10.3
.DATE .DATE
06.02.2025 06.02.2025
@ -481,16 +481,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
exit exit
} }
# Checking whether WMI is corrupted # Check Microsoft Defender state
try if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore))
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -502,9 +496,21 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
} }
# Check Microsoft Defender state # Check Microsoft Defender state
if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore)) try
{
$productState = (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState
$DefenderState = ('0x{0:x}' -f $productState).Substring(3, 2)
# Defender is a currently used AV. Continue...
if ($DefenderState -notmatch "00|01")
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -539,7 +545,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
try try
{ {
$Script:DefenderMpPreferenceBroken = $false $Script:DefenderMpPreferenceBroken = $false
(Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess (Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess
} }
catch [Microsoft.Management.Infrastructure.CimException] catch [Microsoft.Management.Infrastructure.CimException]
{ {
@ -2724,7 +2730,7 @@ function QuickAccessRecentFiles
# Remove all policies in order to make changes visible in UI only if it's possible # Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
@ -4686,7 +4692,7 @@ function WindowsFeatures
[void]$Window.Close() [void]$Window.Close()
$SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose} $SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedFeatures | Enable-WindowsOptionalFeature -Online -NoRestart $SelectedFeatures | Enable-WindowsOptionalFeature -Online -All -NoRestart
} }
function Add-FeatureControl function Add-FeatureControl
@ -7832,7 +7838,7 @@ public static long MakeLong(uint left, uint right)
New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -Type DWord -Value 0 -Force New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -PropertyType DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -8740,7 +8746,7 @@ function RegistryBackup
{ {
"Enable" "Enable"
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -Type DWord -Value 1 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -PropertyType DWord -Value 1 -Force
} }
"Disable" "Disable"
{ {
@ -8802,12 +8808,12 @@ function RecentlyAddedApps
} }
New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DWORD -Value 1 Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DWORD -Value 1
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type CLEAR
} }
} }
} }
@ -8979,17 +8985,14 @@ function CleanupTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -9419,17 +9422,14 @@ function SoftwareDistributionTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -9737,17 +9737,14 @@ function TempTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -9909,7 +9906,8 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object -FilterScript {`$_
(-join ("`$env:SystemDrive\", '`$Windows.~WS')), (-join ("`$env:SystemDrive\", '`$Windows.~WS')),
"`$env:SystemDrive\ESD", "`$env:SystemDrive\ESD",
"`$env:SystemDrive\Intel", "`$env:SystemDrive\Intel",
"`$env:SystemDrive\PerfLogs" "`$env:SystemDrive\PerfLogs",
"`$env:SystemRoot\ServiceProfiles\NetworkService\AppData\Local\Temp"
) )
if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName) if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName)
@ -11721,23 +11719,16 @@ public static void PostMessage()
#endregion Other actions #endregion Other actions
#region Toast notifications #region Toast notifications
# Persist Sophia notifications to prevent to immediately disappear from Action Center
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia))
{
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowInActionCenter -PropertyType DWord -Value 1 -Force
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia)) if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia))
{ {
New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force

6
src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1

@ -3,7 +3,7 @@
Default preset file for "Sophia Script for Windows 10 LTSC 2019" Default preset file for "Sophia Script for Windows 10 LTSC 2019"
.VERSION .VERSION
5.10.2 5.10.3
.DATE .DATE
06.02.2025 06.02.2025
@ -75,7 +75,7 @@ param
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.10.2 | Made with $([System.Char]::ConvertFromUtf32(0x1F497)) of Windows | $([System.Char]0x00A9) Team Sophia, 2014$([System.Char]0x2013)2025" $Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.10.3 | Made with $([System.Char]::ConvertFromUtf32(0x1F497)) of Windows | $([System.Char]0x00A9) Team Sophia, 2014$([System.Char]0x2013)2025"
# Checking whether all files were expanded before running # Checking whether all files were expanded before running
$ScriptFiles = @( $ScriptFiles = @(
@ -123,7 +123,7 @@ try
} }
catch [System.InvalidOperationException] catch [System.InvalidOperationException]
{ {
Write-Warning -Message $Localization.UnsupportedPowerShell Write-Warning -Message ($Localization.UnsupportedPowerShell -f $PSVersionTable.PSVersion.Major, $PSVersionTable.PSVersion.Minor)
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose

17
src/Sophia_Script_for_Windows_10_LTSC_2021/Functions.ps1

@ -156,6 +156,23 @@ $Parameters = @{
continue continue
} }
# If a module command is UserFolders
if ($Command -eq "UserFolders")
{
# Get all command arguments, excluding defaults
foreach ($ParameterSet in $ParameterSets.Name)
{
$ValidValues = ((Get-Command -Name UserFolders).Parametersets.Parameters | Where-Object -FilterScript {$null -eq $_.Attributes.AliasNames}).Attributes.ValidValues
foreach ($ValidValue in $ValidValues)
{
# The "UserFolders -ThreeDObjects Hide" construction
"UserFolders" + " " + "-" + $ParameterSet + " " + $ValidValue | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""}
}
continue
}
}
foreach ($ParameterSet in $ParameterSets.Name) foreach ($ParameterSet in $ParameterSets.Name)
{ {
# The "Function -Argument" construction # The "Function -Argument" construction

2
src/Sophia_Script_for_Windows_10_LTSC_2021/Localizations/pl-PL/Sophia.psd1

@ -1,6 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Skrypt obsługuje tylko 64-bitowe systemy Windows. UnsupportedOSBitness = Skrypt obsługuje tylko 64-bitowe systemy Windows.
UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 Enterprise LTSC 2021. Twój system operacyjny to {0}. UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 Enterprise LTSC 2021. Twoim systemem operacyjnym jest {0}.
UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie. UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie.
UpdateWarning = Twoja wersja systemu Windows 10: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. UpdateWarning = Twoja wersja systemu Windows 10: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie.
UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka. UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka.

97
src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1

@ -481,16 +481,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
exit exit
} }
# Checking whether WMI is corrupted # Check Microsoft Defender state
try if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore))
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -502,9 +496,21 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
} }
# Check Microsoft Defender state # Check Microsoft Defender state
if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore)) try
{
$productState = (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState
$DefenderState = ('0x{0:x}' -f $productState).Substring(3, 2)
# Defender is a currently used AV. Continue...
if ($DefenderState -notmatch "00|01")
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -539,7 +545,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
try try
{ {
$Script:DefenderMpPreferenceBroken = $false $Script:DefenderMpPreferenceBroken = $false
(Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess (Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess
} }
catch [Microsoft.Management.Infrastructure.CimException] catch [Microsoft.Management.Infrastructure.CimException]
{ {
@ -2944,7 +2950,7 @@ function QuickAccessRecentFiles
# Remove all policies in order to make changes visible in UI only if it's possible # Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
@ -5069,7 +5075,7 @@ function WindowsFeatures
[void]$Window.Close() [void]$Window.Close()
$SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose} $SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedFeatures | Enable-WindowsOptionalFeature -Online -NoRestart $SelectedFeatures | Enable-WindowsOptionalFeature -Online -All -NoRestart
} }
function Add-FeatureControl function Add-FeatureControl
@ -8471,7 +8477,7 @@ public static long MakeLong(uint left, uint right)
New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -Type DWord -Value 0 -Force New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -PropertyType DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -9379,7 +9385,7 @@ function RegistryBackup
{ {
"Enable" "Enable"
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -Type DWord -Value 1 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -PropertyType DWord -Value 1 -Force
} }
"Disable" "Disable"
{ {
@ -9610,12 +9616,12 @@ function RecentlyAddedApps
} }
New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DWORD -Value 1 Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DWORD -Value 1
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type CLEAR
} }
} }
} }
@ -10101,17 +10107,14 @@ function CleanupTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -10541,17 +10544,14 @@ function SoftwareDistributionTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -10859,17 +10859,14 @@ function TempTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -11031,7 +11028,8 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object -FilterScript {`$_
(-join ("`$env:SystemDrive\", '`$Windows.~WS')), (-join ("`$env:SystemDrive\", '`$Windows.~WS')),
"`$env:SystemDrive\ESD", "`$env:SystemDrive\ESD",
"`$env:SystemDrive\Intel", "`$env:SystemDrive\Intel",
"`$env:SystemDrive\PerfLogs" "`$env:SystemDrive\PerfLogs",
"`$env:SystemRoot\ServiceProfiles\NetworkService\AppData\Local\Temp"
) )
if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName) if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName)
@ -13086,23 +13084,16 @@ public static void PostMessage()
#endregion Other actions #endregion Other actions
#region Toast notifications #region Toast notifications
# Persist Sophia notifications to prevent to immediately disappear from Action Center
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia))
{
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowInActionCenter -PropertyType DWord -Value 1 -Force
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia)) if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia))
{ {
New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force

2
src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1

@ -123,7 +123,7 @@ try
} }
catch [System.InvalidOperationException] catch [System.InvalidOperationException]
{ {
Write-Warning -Message $Localization.UnsupportedPowerShell Write-Warning -Message ($Localization.UnsupportedPowerShell -f $PSVersionTable.PSVersion.Major, $PSVersionTable.PSVersion.Minor)
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/de-DE/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Bitte schließen Sie PowerShell 7 und führen Sie das Skript erneut aus.
UnsupportedOSBitness = Das Skript unterstützt nur 64-Bit-Windows. UnsupportedOSBitness = Das Skript unterstützt nur 64-Bit-Windows.
UnsupportedOSBuild = Das Skript unterstützt nur Windows 10 22H2. Ihr Betriebssystem ist {0}. UnsupportedOSBuild = Das Skript unterstützt nur Windows 10 22H2. Ihr Betriebssystem ist {0}.
UnsupportedWindowsTerminal = Die Windows Terminal-Version ist niedriger als 1.20. Bitte aktualisieren Sie es im Microsoft Store und versuchen Sie es erneut. UnsupportedWindowsTerminal = Die Windows Terminal-Version ist niedriger als 1.20. Bitte aktualisieren Sie es im Microsoft Store und versuchen Sie es erneut.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/en-US/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Please close PowerShell 7 and re-run the script again.
UnsupportedOSBitness = The script supports 64-bit Windows only. UnsupportedOSBitness = The script supports 64-bit Windows only.
UnsupportedOSBuild = The script supports only Windows 10 22H2. Your OS is {0}. UnsupportedOSBuild = The script supports only Windows 10 22H2. Your OS is {0}.
UnsupportedWindowsTerminal = Windows Terminal version is lower than 1.20. Please update it in the Microsoft Store and try again. UnsupportedWindowsTerminal = Windows Terminal version is lower than 1.20. Please update it in the Microsoft Store and try again.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/es-ES/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Cierre PowerShell 7 y vuelva a ejecutar el script.
UnsupportedOSBitness = El script sólo es compatible con Windows de 64 bits. UnsupportedOSBitness = El script sólo es compatible con Windows de 64 bits.
UnsupportedOSBuild = El script sólo es compatible con Windows 10 22H2. Su sistema operativo es {0}. UnsupportedOSBuild = El script sólo es compatible con Windows 10 22H2. Su sistema operativo es {0}.
UnsupportedWindowsTerminal = La versión de Windows Terminal es inferior a la 1.20. Por favor, actualízala en la Microsoft Store e inténtalo de nuevo. UnsupportedWindowsTerminal = La versión de Windows Terminal es inferior a la 1.20. Por favor, actualízala en la Microsoft Store e inténtalo de nuevo.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/fr-FR/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Veuillez fermer PowerShell 7 et réexécuter le script.
UnsupportedOSBitness = Le script n'est compatible qu'avec Windows 64 bits. UnsupportedOSBitness = Le script n'est compatible qu'avec Windows 64 bits.
UnsupportedOSBuild = Le script ne supporte que Windows 10 22H2. Votre système d'exploitation est {0}. UnsupportedOSBuild = Le script ne supporte que Windows 10 22H2. Votre système d'exploitation est {0}.
UnsupportedWindowsTerminal = La version de Windows Terminal est inférieure à 1.20. Veuillez la mettre à jour dans le Microsoft Store et réessayer. UnsupportedWindowsTerminal = La version de Windows Terminal est inférieure à 1.20. Veuillez la mettre à jour dans le Microsoft Store et réessayer.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/hu-HU/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Kérjük, zárja be a PowerShell 7 programot, és futtassa újra a szkriptet.
UnsupportedOSBitness = A szkript csak a 64 bites Windows-t támogatja. UnsupportedOSBitness = A szkript csak a 64 bites Windows-t támogatja.
UnsupportedOSBuild = A szkript csak a Windows 10 22H2 rendszert támogatja. Az Ön operációs rendszere {0}. UnsupportedOSBuild = A szkript csak a Windows 10 22H2 rendszert támogatja. Az Ön operációs rendszere {0}.
UnsupportedWindowsTerminal = A Windows Terminal verziója alacsonyabb, mint 1.20. Kérjük, frissítse azt a Microsoft Store-ban, és próbálja meg újra. UnsupportedWindowsTerminal = A Windows Terminal verziója alacsonyabb, mint 1.20. Kérjük, frissítse azt a Microsoft Store-ban, és próbálja meg újra.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/it-IT/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Chiudere PowerShell 7 e rieseguire lo script.
UnsupportedOSBitness = Lo script supporta solo Windows a 64 bit. UnsupportedOSBitness = Lo script supporta solo Windows a 64 bit.
UnsupportedOSBuild = Lo script supporta solo Windows 10 22H2. Il vostro sistema operativo è {0}. UnsupportedOSBuild = Lo script supporta solo Windows 10 22H2. Il vostro sistema operativo è {0}.
UnsupportedWindowsTerminal = La versione di Windows Terminal è inferiore a 1.20. Aggiornarla nel Microsoft Store e riprovare. UnsupportedWindowsTerminal = La versione di Windows Terminal è inferiore a 1.20. Aggiornarla nel Microsoft Store e riprovare.

3
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/pl-PL/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Zamknij PowerShell 7 i ponownie uruchom skrypt.
UnsupportedOSBitness = Skrypt obsługuje tylko 64-bitowe systemy Windows. UnsupportedOSBitness = Skrypt obsługuje tylko 64-bitowe systemy Windows.
UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 22H2. Twój system operacyjny to {0}. UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 22H2. Twoim systemem operacyjnym jest {0}.
UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie. UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie.
UpdateWarning = Twoja wersja systemu Windows 10: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. UpdateWarning = Twoja wersja systemu Windows 10: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie.
UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka. UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/pt-BR/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Feche o PowerShell 7 e execute o script novamente.
UnsupportedOSBitness = O guião suporta apenas Windows de 64 bits. UnsupportedOSBitness = O guião suporta apenas Windows de 64 bits.
UnsupportedOSBuild = O script é compatível apenas com o Windows 10 22H2. Seu sistema operacional é o {0}. UnsupportedOSBuild = O script é compatível apenas com o Windows 10 22H2. Seu sistema operacional é o {0}.
UnsupportedWindowsTerminal = A versão do Windows Terminal é inferior a 1.20. Atualize-a na Microsoft Store e tente novamente. UnsupportedWindowsTerminal = A versão do Windows Terminal é inferior a 1.20. Atualize-a na Microsoft Store e tente novamente.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/ru-RU/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Пожалуйста, закройте PowerShell 7 и запустите скрип заново.
UnsupportedOSBitness = Скрипт поддерживает только 64-битную версию Windows. UnsupportedOSBitness = Скрипт поддерживает только 64-битную версию Windows.
UnsupportedOSBuild = Скрипт поддерживает только Windows 10 22H2. Ваша ОС {0}. UnsupportedOSBuild = Скрипт поддерживает только Windows 10 22H2. Ваша ОС {0}.
UnsupportedWindowsTerminal = Версия Windows Terminal ниже 1.20. Пожалуйста, обновите его в Microsoft Store и попробуйте заново. UnsupportedWindowsTerminal = Версия Windows Terminal ниже 1.20. Пожалуйста, обновите его в Microsoft Store и попробуйте заново.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/tr-TR/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Lütfen PowerShell 7 yi kapatın ve komut dosyasını yeniden çalıştırın.
UnsupportedOSBitness = Komut dosyası yalnızca 64 bit Windows'u destekler. UnsupportedOSBitness = Komut dosyası yalnızca 64 bit Windows'u destekler.
UnsupportedOSBuild = Komut dosyası yalnızca Windows 10 22H2'yi destekler. Sizin işletim sisteminiz {0}. UnsupportedOSBuild = Komut dosyası yalnızca Windows 10 22H2'yi destekler. Sizin işletim sisteminiz {0}.
UnsupportedWindowsTerminal = Windows Terminal sürümü 1.20'den daha düşük. Lütfen Microsoft Store'da güncelleyin ve tekrar deneyin. UnsupportedWindowsTerminal = Windows Terminal sürümü 1.20'den daha düşük. Lütfen Microsoft Store'da güncelleyin ve tekrar deneyin.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/uk-UA/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Будь ласка, закрийте PowerShell 7 і запустіть сценарій знову.
UnsupportedOSBitness = Скрипт підтримує тільки 64-розрядну версію Windows. UnsupportedOSBitness = Скрипт підтримує тільки 64-розрядну версію Windows.
UnsupportedOSBuild = Скрипт підтримує тільки Windows 10 22H2. Ваша ОС {0}. UnsupportedOSBuild = Скрипт підтримує тільки Windows 10 22H2. Ваша ОС {0}.
UnsupportedWindowsTerminal = Версія Windows Terminal нижча за 1.20. Будь ласка, оновіть його в Microsoft Store і спробуйте заново. UnsupportedWindowsTerminal = Версія Windows Terminal нижча за 1.20. Будь ласка, оновіть його в Microsoft Store і спробуйте заново.

1
src/Sophia_Script_for_Windows_10_PowerShell_7/Localizations/zh-CN/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = 请关闭PowerShell 7并重新运行脚本
UnsupportedOSBitness = 该脚本仅支持64位Windows UnsupportedOSBitness = 该脚本仅支持64位Windows
UnsupportedOSBuild = 腳本僅支援 Windows 10 22H2您的作業系統是 {0} UnsupportedOSBuild = 腳本僅支援 Windows 10 22H2您的作業系統是 {0}
UnsupportedWindowsTerminal = Windows Terminal版本低於1.20請在Microsoft商店更新後再試 UnsupportedWindowsTerminal = Windows Terminal版本低於1.20請在Microsoft商店更新後再試

113
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -67,7 +67,21 @@ function InitialActions
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Import PowerShell 5.1 modules # Import PowerShell 5.1 modules
Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx, DISM -UseWindowsPowerShell try
{
Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx, DISM -UseWindowsPowerShell -Force -ErrorAction Stop
}
catch
{
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.PowerShellImportFailed
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
exit
}
# https://github.com/PowerShell/PowerShell/issues/21070 # https://github.com/PowerShell/PowerShell/issues/21070
$Script:CompilerOptions = [System.CodeDom.Compiler.CompilerParameters]::new("System.dll") $Script:CompilerOptions = [System.CodeDom.Compiler.CompilerParameters]::new("System.dll")
@ -522,16 +536,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
exit exit
} }
# Checking whether WMI is corrupted # Check Microsoft Defender state
try if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore))
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -543,9 +551,21 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
} }
# Check Microsoft Defender state # Check Microsoft Defender state
if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore)) try
{ {
$productState = (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState
$DefenderState = ('0x{0:x}' -f $productState).Substring(3, 2)
# Defender is a currently used AV. Continue...
if ($DefenderState -notmatch "00|01")
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
}
catch [Microsoft.Management.Infrastructure.CimException]
{
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -580,7 +600,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
try try
{ {
$Script:DefenderMpPreferenceBroken = $false $Script:DefenderMpPreferenceBroken = $false
(Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess (Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess
} }
catch [System.Management.Automation.RemoteException] catch [System.Management.Automation.RemoteException]
{ {
@ -3288,7 +3308,7 @@ function QuickAccessRecentFiles
# Remove all policies in order to make changes visible in UI only if it's possible # Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
@ -6102,7 +6122,7 @@ function WindowsFeatures
[void]$Window.Close() [void]$Window.Close()
$SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose} $SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedFeatures | Enable-WindowsOptionalFeature -Online -NoRestart $SelectedFeatures | Enable-WindowsOptionalFeature -Online -All -NoRestart
} }
function Add-FeatureControl function Add-FeatureControl
@ -9628,7 +9648,7 @@ public static long MakeLong(uint left, uint right)
New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -Type DWord -Value 0 -Force New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -PropertyType DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -10588,7 +10608,7 @@ function RegistryBackup
{ {
"Enable" "Enable"
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -Type DWord -Value 1 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -PropertyType DWord -Value 1 -Force
} }
"Disable" "Disable"
{ {
@ -10819,12 +10839,12 @@ function RecentlyAddedApps
} }
New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -PropertyType DWord -Value 1 -Force
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DWORD -Value 1 Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type DWORD -Value 1
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Force -ErrorAction Ignore
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecentlyAddedApps -Type CLEAR
} }
} }
} }
@ -12228,17 +12248,14 @@ function CleanupTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -12668,17 +12685,14 @@ function SoftwareDistributionTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -12986,17 +13000,14 @@ function TempTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking if we're trying to create the task when it was already created as another user # Checking if we're trying to create the task when it was already created as another user
@ -13158,7 +13169,8 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object -FilterScript {`$_
(-join ("`$env:SystemDrive\", '`$Windows.~WS')), (-join ("`$env:SystemDrive\", '`$Windows.~WS')),
"`$env:SystemDrive\ESD", "`$env:SystemDrive\ESD",
"`$env:SystemDrive\Intel", "`$env:SystemDrive\Intel",
"`$env:SystemDrive\PerfLogs" "`$env:SystemDrive\PerfLogs",
"`$env:SystemRoot\ServiceProfiles\NetworkService\AppData\Local\Temp"
) )
if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName) if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName)
@ -15295,23 +15307,16 @@ public static void PostMessage()
#endregion Other actions #endregion Other actions
#region Toast notifications #region Toast notifications
# Persist Sophia notifications to prevent to immediately disappear from Action Center
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia))
{
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowInActionCenter -PropertyType DWord -Value 1 -Force
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia)) if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia))
{ {
New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force

2
src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1

@ -129,7 +129,7 @@ try
} }
catch [System.InvalidOperationException] catch [System.InvalidOperationException]
{ {
Write-Warning -Message $Localization.UnsupportedPowerShell Write-Warning -Message ($Localization.UnsupportedPowerShell -f $PSVersionTable.PSVersion.Major, $PSVersionTable.PSVersion.Minor)
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose

4
src/Sophia_Script_for_Windows_11/Localizations/fr-FR/Sophia.psd1

@ -1,7 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Le script est compatible avec Windows 11 23H2 et les versions ultérieures. Votre système d'exploitation est {0}. UnsupportedOSBuild = Le script ne supporte que Windows 11 23H2. Votre système d'exploitation est {0}.
UnsupportedWindowsTerminal = La version de Windows Terminal est inférieure à 1.20. Veuillez la mettre à jour dans le Microsoft Store et réessayer. UnsupportedWindowsTerminal = La version de Windows Terminal est inférieure à 1.20. Veuillez la mettre à jour dans le Microsoft Store et réessayer.
UpdateWarning = Votre version de Windows 11 : {0}.{1}. Versions prises en charge: {2} et plus. Exécutez Windows Update et réessayez. UpdateWarning = Votre version de Windows 11: {0}.{1}. Versions prises en charge: {2} et plus. Exécutez Windows Update et réessayez.
UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité. UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité.
LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur. LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur.
UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell. UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell.

2
src/Sophia_Script_for_Windows_11/Localizations/hu-HU/Sophia.psd1

@ -1,5 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = A szkript támogatja a Windows 11 23H2 és magasabb verziószámú operációs rendszereket. Az Ön {0}. UnsupportedOSBuild = A szkript támogatja a Windows 11 23H2 és magasabb verziószámú operációs rendszereket. Az Ön operációs rendszere {0}.
UnsupportedWindowsTerminal = A Windows Terminal verziója alacsonyabb, mint 1.20. Kérjük, frissítse azt a Microsoft Store-ban, és próbálja meg újra. UnsupportedWindowsTerminal = A Windows Terminal verziója alacsonyabb, mint 1.20. Kérjük, frissítse azt a Microsoft Store-ban, és próbálja meg újra.
UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott buildek: {2} és újabb verziók. Futtassa a Windows Update programot, és próbálja meg újra. UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott buildek: {2} és újabb verziók. Futtassa a Windows Update programot, és próbálja meg újra.
UnsupportedLanguageMode = A PowerShell munkamenet korlátozott nyelvi üzemmódban fut. UnsupportedLanguageMode = A PowerShell munkamenet korlátozott nyelvi üzemmódban fut.

2
src/Sophia_Script_for_Windows_11/Localizations/tr-TR/Sophia.psd1

@ -1,5 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Komut dosyası Windows 11 23H2 ve üstünü destekler. İşletim sisteminiz {0}. UnsupportedOSBuild = Komut dosyası Windows 11 23H2 ve üstünü destekler. Sizin işletim sisteminiz {0}.
UnsupportedWindowsTerminal = Windows Terminal sürümü 1.20'den daha düşük. Lütfen Microsoft Store'da güncelleyin ve tekrar deneyin. UnsupportedWindowsTerminal = Windows Terminal sürümü 1.20'den daha düşük. Lütfen Microsoft Store'da güncelleyin ve tekrar deneyin.
UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapılar: {2} ve üzeri sürümler.. Windows Update'i çalıştırın ve tekrar deneyin. UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapılar: {2} ve üzeri sürümler.. Windows Update'i çalıştırın ve tekrar deneyin.
UnsupportedLanguageMode = Sınırlı bir dil modunda çalışan PowerShell oturumu. UnsupportedLanguageMode = Sınırlı bir dil modunda çalışan PowerShell oturumu.

105
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -496,16 +496,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
exit exit
} }
# Checking whether WMI is corrupted # Check Microsoft Defender state
try if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore))
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -517,9 +511,21 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
} }
# Check Microsoft Defender state # Check Microsoft Defender state
if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore)) try
{
$productState = (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState
$DefenderState = ('0x{0:x}' -f $productState).Substring(3, 2)
# Defender is a currently used AV. Continue...
if ($DefenderState -notmatch "00|01")
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -554,7 +560,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
try try
{ {
$Script:DefenderMpPreferenceBroken = $false $Script:DefenderMpPreferenceBroken = $false
(Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess (Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess
} }
catch [Microsoft.Management.Infrastructure.CimException] catch [Microsoft.Management.Infrastructure.CimException]
{ {
@ -3056,7 +3062,7 @@ function QuickAccessRecentFiles
# Remove all policies in order to make changes visible in UI only if it's possible # Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
@ -4673,14 +4679,14 @@ function StartRecommendedSection
New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -PropertyType DWord -Value 1 -Force
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1 Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start -Name HideRecommendedSection -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start -Name HideRecommendedSection -Force -ErrorAction Ignore
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR
} }
} }
} }
@ -5580,7 +5586,7 @@ function WindowsFeatures
[void]$Window.Close() [void]$Window.Close()
$SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose} $SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedFeatures | Enable-WindowsOptionalFeature -Online -NoRestart $SelectedFeatures | Enable-WindowsOptionalFeature -Online -All -NoRestart
} }
function Add-FeatureControl function Add-FeatureControl
@ -9097,7 +9103,7 @@ public static long MakeLong(uint left, uint right)
New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -Type DWord -Value 0 -Force New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -PropertyType DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -10082,7 +10088,7 @@ function RegistryBackup
{ {
"Enable" "Enable"
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -Type DWord -Value 1 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -PropertyType DWord -Value 1 -Force
} }
"Disable" "Disable"
{ {
@ -11187,19 +11193,19 @@ function CleanupTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled # Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking whether VBS engine is enabled # Checking whether VBS engine is enabled
if ((Get-WindowsCapability -Online -Name VBSCRIPT*).State -ne "Installed") if ((Get-WindowsCapability -Online -Name VBSCRIPT*).State -ne "Installed")
{ {
@ -11293,13 +11299,6 @@ function CleanupTask
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$VolumeCache" -Name StateFlags1337 -PropertyType DWord -Value 2 -Force
} }
# Persist Sophia notifications to prevent to immediately disappear from Action Center
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia))
{
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowInActionCenter -PropertyType DWord -Value 1 -Force
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia)) if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia))
{ {
New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force
@ -11648,17 +11647,14 @@ function SoftwareDistributionTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking whether VBS engine is enabled # Checking whether VBS engine is enabled
@ -11987,17 +11983,14 @@ function TempTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking whether VBS engine is enabled # Checking whether VBS engine is enabled
@ -12180,7 +12173,8 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object -FilterScript {`$_
(-join ("`$env:SystemDrive\", '`$Windows.~WS')), (-join ("`$env:SystemDrive\", '`$Windows.~WS')),
"`$env:SystemDrive\ESD", "`$env:SystemDrive\ESD",
"`$env:SystemDrive\Intel", "`$env:SystemDrive\Intel",
"`$env:SystemDrive\PerfLogs" "`$env:SystemDrive\PerfLogs",
"`$env:SystemRoot\ServiceProfiles\NetworkService\AppData\Local\Temp"
) )
if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName) if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName)
@ -14249,23 +14243,16 @@ public static void PostMessage()
#endregion Other actions #endregion Other actions
#region Toast notifications #region Toast notifications
# Persist Sophia notifications to prevent to immediately disappear from Action Center
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia))
{
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowInActionCenter -PropertyType DWord -Value 1 -Force
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia)) if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia))
{ {
New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force

2
src/Sophia_Script_for_Windows_11/Sophia.ps1

@ -121,7 +121,7 @@ try
} }
catch [System.InvalidOperationException] catch [System.InvalidOperationException]
{ {
Write-Warning -Message $Localization.UnsupportedPowerShell Write-Warning -Message ($Localization.UnsupportedPowerShell -f $PSVersionTable.PSVersion.Major, $PSVersionTable.PSVersion.Minor)
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose

2
src/Sophia_Script_for_Windows_11_LTSC_2024/Localizations/fr-FR/Sophia.psd1

@ -1,7 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Le script ne supporte que Windows 11 Enterprise LTSC 2024. Votre système d'exploitation est {0}. UnsupportedOSBuild = Le script ne supporte que Windows 11 Enterprise LTSC 2024. Votre système d'exploitation est {0}.
UnsupportedWindowsTerminal = La version de Windows Terminal est inférieure à 1.20. Veuillez la mettre à jour dans le Microsoft Store et réessayer. UnsupportedWindowsTerminal = La version de Windows Terminal est inférieure à 1.20. Veuillez la mettre à jour dans le Microsoft Store et réessayer.
UpdateWarning = Votre version de Windows 11 : {0}.{1}. Versions prises en charge: {2} et plus. Exécutez Windows Update et réessayez. UpdateWarning = Votre version de Windows 11: {0}.{1}. Versions prises en charge: {2} et plus. Exécutez Windows Update et réessayez.
UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité. UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité.
LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur. LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur.
UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell. UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell.

2
src/Sophia_Script_for_Windows_11_LTSC_2024/Localizations/pl-PL/Sophia.psd1

@ -1,5 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 Enterprise LTSC 2021. Twój system operacyjny to {0}. UnsupportedOSBuild = Skrypt obsługuje tylko system Windows 10 Enterprise LTSC 2021. Twoim systemem operacyjnym jest {0}.
UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie. UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie.
UpdateWarning = Twoja wersja systemu Windows 11: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. UpdateWarning = Twoja wersja systemu Windows 11: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie.
UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka. UnsupportedLanguageMode = Sesja PowerShell działa w trybie ograniczonego języka.

97
src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1

@ -482,16 +482,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
exit exit
} }
# Checking whether WMI is corrupted # Check Microsoft Defender state
try if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore))
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -503,9 +497,21 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
} }
# Check Microsoft Defender state # Check Microsoft Defender state
if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore)) try
{
$productState = (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState
$DefenderState = ('0x{0:x}' -f $productState).Substring(3, 2)
# Defender is a currently used AV. Continue...
if ($DefenderState -notmatch "00|01")
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -540,7 +546,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
try try
{ {
$Script:DefenderMpPreferenceBroken = $false $Script:DefenderMpPreferenceBroken = $false
(Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess (Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess
} }
catch [Microsoft.Management.Infrastructure.CimException] catch [Microsoft.Management.Infrastructure.CimException]
{ {
@ -3027,7 +3033,7 @@ function QuickAccessRecentFiles
# Remove all policies in order to make changes visible in UI only if it's possible # Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
@ -4493,14 +4499,14 @@ function StartRecommendedSection
New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -PropertyType DWord -Value 1 -Force
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1 Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start -Name HideRecommendedSection -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start -Name HideRecommendedSection -Force -ErrorAction Ignore
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR
} }
} }
} }
@ -5108,7 +5114,7 @@ function WindowsFeatures
[void]$Window.Close() [void]$Window.Close()
$SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose} $SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedFeatures | Enable-WindowsOptionalFeature -Online -NoRestart $SelectedFeatures | Enable-WindowsOptionalFeature -Online -All -NoRestart
} }
function Add-FeatureControl function Add-FeatureControl
@ -8625,7 +8631,7 @@ public static long MakeLong(uint left, uint right)
New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -Type DWord -Value 0 -Force New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -PropertyType DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -9533,7 +9539,7 @@ function RegistryBackup
{ {
"Enable" "Enable"
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -Type DWord -Value 1 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -PropertyType DWord -Value 1 -Force
} }
"Disable" "Disable"
{ {
@ -10457,17 +10463,14 @@ function CleanupTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking whether VBS engine is enabled # Checking whether VBS engine is enabled
@ -10918,17 +10921,14 @@ function SoftwareDistributionTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking whether VBS engine is enabled # Checking whether VBS engine is enabled
@ -11257,17 +11257,14 @@ function TempTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking whether VBS engine is enabled # Checking whether VBS engine is enabled
@ -11450,7 +11447,8 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object -FilterScript {`$_
(-join ("`$env:SystemDrive\", '`$Windows.~WS')), (-join ("`$env:SystemDrive\", '`$Windows.~WS')),
"`$env:SystemDrive\ESD", "`$env:SystemDrive\ESD",
"`$env:SystemDrive\Intel", "`$env:SystemDrive\Intel",
"`$env:SystemDrive\PerfLogs" "`$env:SystemDrive\PerfLogs",
"`$env:SystemRoot\ServiceProfiles\NetworkService\AppData\Local\Temp"
) )
if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName) if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName)
@ -13078,23 +13076,16 @@ public static void PostMessage()
#endregion Other actions #endregion Other actions
#region Toast notifications #region Toast notifications
# Persist Sophia notifications to prevent to immediately disappear from Action Center
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia))
{
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowInActionCenter -PropertyType DWord -Value 1 -Force
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia)) if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia))
{ {
New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force

2
src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1

@ -122,7 +122,7 @@ try
} }
catch [System.InvalidOperationException] catch [System.InvalidOperationException]
{ {
Write-Warning -Message $Localization.UnsupportedPowerShell Write-Warning -Message ($Localization.UnsupportedPowerShell -f $PSVersionTable.PSVersion.Major, $PSVersionTable.PSVersion.Minor)
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose

1
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/de-DE/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Bitte schließen Sie PowerShell 7 und führen Sie das Skript erneut aus.
UnsupportedOSBuild = Das Skript unterstützt Windows 11 23H2 und höher. Ihr Betriebssystem ist {0}. UnsupportedOSBuild = Das Skript unterstützt Windows 11 23H2 und höher. Ihr Betriebssystem ist {0}.
UnsupportedWindowsTerminal = Die Windows Terminal-Version ist niedriger als 1.20. Bitte aktualisieren Sie es im Microsoft Store und versuchen Sie es erneut. UnsupportedWindowsTerminal = Die Windows Terminal-Version ist niedriger als 1.20. Bitte aktualisieren Sie es im Microsoft Store und versuchen Sie es erneut.
UpdateWarning = Ihr Windows 11-Build: {0}.{1}. Unterstützter Builds: {2} und höher. Führen Sie Windows Update aus und versuchen Sie es erneut. UpdateWarning = Ihr Windows 11-Build: {0}.{1}. Unterstützter Builds: {2} und höher. Führen Sie Windows Update aus und versuchen Sie es erneut.

1
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/en-US/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Please close PowerShell 7 and re-run the script again.
UnsupportedOSBuild = The script supports Windows 11 23H2 and higher. Your OS is {0}. UnsupportedOSBuild = The script supports Windows 11 23H2 and higher. Your OS is {0}.
UnsupportedWindowsTerminal = Windows Terminal version is lower than 1.20. Please update it in the Microsoft Store and try again. UnsupportedWindowsTerminal = Windows Terminal version is lower than 1.20. Please update it in the Microsoft Store and try again.
UpdateWarning = Your Windows 11 build: {0}.{1}. Supported builds: {2} and higher. Run Windows Update and try again. UpdateWarning = Your Windows 11 build: {0}.{1}. Supported builds: {2} and higher. Run Windows Update and try again.

3
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/es-ES/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Cierre PowerShell 7 y vuelva a ejecutar el script.
UnsupportedOSBuild = El script es compatible con Windows 11 23H2 y superiores. Su sistema operativo es {0}. UnsupportedOSBuild = El script es compatible con Windows 11 23H2 y superiores. Su sistema operativo es {0}.
UnsupportedWindowsTerminal = La versión de Windows Terminal es inferior a la 1.20. Por favor, actualízala en la Microsoft Store e inténtalo de nuevo. UnsupportedWindowsTerminal = La versión de Windows Terminal es inferior a la 1.20. Por favor, actualízala en la Microsoft Store e inténtalo de nuevo.
UpdateWarning = Su build de Windows 11: {0}.{1}. Compilaciones compatibles: {2} y superior. Ejecute Windows Update y vuelva a intentarlo. UpdateWarning = Su build de Windows 11: {0}.{1}. Compilaciones compatibles: {2} y superior. Ejecute Windows Update y vuelva a intentarlo.
@ -14,7 +15,7 @@ UnsupportedRelease = Se ha encontrado una nueva versión
KeyboardArrows = Utilice las flechas {0} y {1} de su teclado para seleccionar la respuesta KeyboardArrows = Utilice las flechas {0} y {1} de su teclado para seleccionar la respuesta
CustomizationWarning = ¿Ha personalizado todas las funciones del archivo predeterminado {0} antes de ejecutar Sophia Script? CustomizationWarning = ¿Ha personalizado todas las funciones del archivo predeterminado {0} antes de ejecutar Sophia Script?
WindowsComponentBroken = {0} dañado o eliminado del sistema operativo. Reinstale Windows utilizando sólo una imagen ISO original. WindowsComponentBroken = {0} dañado o eliminado del sistema operativo. Reinstale Windows utilizando sólo una imagen ISO original.
MicroSoftStorePowerShellWarning = PowerShell descargado de Microsoft Store no es compatible. Ejecute una versión MSI.\nhttps://github.com/powershell/powershell/releases/latest MicroSoftStorePowerShellWarning = PowerShell téléchargé depuis le Microsoft Store n'est pas pris en charge. Veuillez exécuter une version MSI.\nhttps://github.com/powershell/powershell/releases/latest
ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado. ControlledFolderAccessDisabled = Acceso a la carpeta controlada deshabilitado.
InitialActionsCheckFailed = La función InitialActions no se puede cargar desde el archivo de presets {0}. Compruebe el archivo de preajuste y vuelva a intentarlo. InitialActionsCheckFailed = La función InitialActions no se puede cargar desde el archivo de presets {0}. Compruebe el archivo de preajuste y vuelva a intentarlo.
ScheduledTasks = Tareas programadas ScheduledTasks = Tareas programadas

7
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/fr-FR/Sophia.psd1

@ -1,7 +1,8 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Le script est compatible avec Windows 11 23H2 et les versions ultérieures. Votre système d'exploitation est {0}. PowerShellImportFailed = Veuillez fermer PowerShell 7 et réexécuter le script.
UnsupportedOSBuild = Le script ne supporte que Windows 11 23H2. Votre système d'exploitation est {0}.
UnsupportedWindowsTerminal = La version de Windows Terminal est inférieure à 1.20. Veuillez la mettre à jour dans le Microsoft Store et réessayer. UnsupportedWindowsTerminal = La version de Windows Terminal est inférieure à 1.20. Veuillez la mettre à jour dans le Microsoft Store et réessayer.
UpdateWarning = Votre version de Windows 11 : {0}.{1}. Versions prises en charge: {2} et plus. Exécutez Windows Update et réessayez. UpdateWarning = Votre version de Windows 11: {0}.{1}. Versions prises en charge: {2} et plus. Exécutez Windows Update et réessayez.
UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité. UnsupportedLanguageMode = La session PowerShell s'exécute dans un mode de langue limité.
LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur. LoggedInUserNotAdmin = L'utilisateur connecté n'a pas de droits d'administrateur.
UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell. UnsupportedPowerShell = Vous essayez d'exécuter le script via PowerShell {0}.{1}. Exécutez le script dans la version appropriée de PowerShell.
@ -14,7 +15,7 @@ UnsupportedRelease = Une nouvelle version du script a ét
KeyboardArrows = Veuillez utiliser les touches fléchées {0} et {1} de votre clavier pour sélectionner votre réponse KeyboardArrows = Veuillez utiliser les touches fléchées {0} et {1} de votre clavier pour sélectionner votre réponse
CustomizationWarning = Avez-vous personnalisé chaque fonction du fichier de préréglage {0} avant d'exécuter Sophia Script? CustomizationWarning = Avez-vous personnalisé chaque fonction du fichier de préréglage {0} avant d'exécuter Sophia Script?
WindowsComponentBroken = {0} cassé ou supprimé du système d'exploitation. Réinstallez Windows en utilisant uniquement une image ISO authentique. WindowsComponentBroken = {0} cassé ou supprimé du système d'exploitation. Réinstallez Windows en utilisant uniquement une image ISO authentique.
MicroSoftStorePowerShellWarning = PowerShell téléchargé depuis le Microsoft Store n'est pas pris en charge. Veuillez exécuter une version MSI. MicroSoftStorePowerShellWarning = PowerShell téléchargé depuis le Microsoft Store n'est pas pris en charge. Veuillez exécuter une version MSI.\nhttps://github.com/powershell/powershell/releases/latest
ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé. ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé.
InitialActionsCheckFailed = La fonction InitialActions ne peut pas être chargée à partir du fichier de présélection {0}. Veuillez vérifier le fichier de présélection et réessayer. InitialActionsCheckFailed = La fonction InitialActions ne peut pas être chargée à partir du fichier de présélection {0}. Veuillez vérifier le fichier de présélection et réessayer.
ScheduledTasks = Tâches planifiées ScheduledTasks = Tâches planifiées

3
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/hu-HU/Sophia.psd1

@ -1,5 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = A szkript támogatja a Windows 11 23H2 és magasabb verziószámú operációs rendszereket. Az Ön {0}. PowerShellImportFailed = Kérjük, zárja be a PowerShell 7 programot, és futtassa újra a szkriptet.
UnsupportedOSBuild = A szkript támogatja a Windows 11 23H2 és magasabb verziószámú operációs rendszereket. Az Ön operációs rendszere {0}.
UnsupportedWindowsTerminal = A Windows Terminal verziója alacsonyabb, mint 1.20. Kérjük, frissítse azt a Microsoft Store-ban, és próbálja meg újra. UnsupportedWindowsTerminal = A Windows Terminal verziója alacsonyabb, mint 1.20. Kérjük, frissítse azt a Microsoft Store-ban, és próbálja meg újra.
UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott buildek: {2} és újabb verziók. Futtassa a Windows Update programot, és próbálja meg újra. UpdateWarning = Az Ön Windows 11 építése: {0}.{1}. Támogatott buildek: {2} és újabb verziók. Futtassa a Windows Update programot, és próbálja meg újra.
UnsupportedLanguageMode = A PowerShell munkamenet korlátozott nyelvi üzemmódban fut. UnsupportedLanguageMode = A PowerShell munkamenet korlátozott nyelvi üzemmódban fut.

1
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/it-IT/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Chiudere PowerShell 7 e rieseguire lo script.
UnsupportedOSBuild = Lo script supporta Windows 11 23H2 e versioni successive. Il vostro sistema operativo è {0}. UnsupportedOSBuild = Lo script supporta Windows 11 23H2 e versioni successive. Il vostro sistema operativo è {0}.
UnsupportedWindowsTerminal = La versione di Windows Terminal è inferiore a 1.20. Aggiornarla nel Microsoft Store e riprovare. UnsupportedWindowsTerminal = La versione di Windows Terminal è inferiore a 1.20. Aggiornarla nel Microsoft Store e riprovare.
UpdateWarning = La tua build di Windows 11 {0}.{1} non è supportata. Build supportate: {2} e successive. Eseguire Windows Update e riprovare. UpdateWarning = La tua build di Windows 11 {0}.{1} non è supportata. Build supportate: {2} e successive. Eseguire Windows Update e riprovare.

1
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pl-PL/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Zamknij PowerShell 7 i ponownie uruchom skrypt.
UnsupportedOSBuild = Skrypt obsługuje system Windows 11 23H2 i nowsze wersje. Twoim systemem operacyjnym jest {0}. UnsupportedOSBuild = Skrypt obsługuje system Windows 11 23H2 i nowsze wersje. Twoim systemem operacyjnym jest {0}.
UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie. UnsupportedWindowsTerminal = Wersja Windows Terminal jest niższa niż 1.20. Zaktualizuj w Microsoft Store i spróbuj ponownie.
UpdateWarning = Twoja wersja systemu Windows 11: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie. UpdateWarning = Twoja wersja systemu Windows 11: {0}.{1}. Obsługiwane kompilacje: {2} i nowsze. Uruchom aktualizację systemu Windows i spróbuj ponownie.

1
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/pt-BR/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Feche o PowerShell 7 e execute o script novamente.
UnsupportedOSBuild = O script é compatível com o Windows 11 23H2 e superior. Seu sistema operacional é o {0}. UnsupportedOSBuild = O script é compatível com o Windows 11 23H2 e superior. Seu sistema operacional é o {0}.
UnsupportedWindowsTerminal = A versão do Windows Terminal é inferior a 1.20. Atualize-a na Microsoft Store e tente novamente. UnsupportedWindowsTerminal = A versão do Windows Terminal é inferior a 1.20. Atualize-a na Microsoft Store e tente novamente.
UpdateWarning = La tua build di Windows 11: {0}.{1}. Build suportadas: {2}+. Execute o Windows Update e tente novamente. UpdateWarning = La tua build di Windows 11: {0}.{1}. Build suportadas: {2}+. Execute o Windows Update e tente novamente.

1
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/ru-RU/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Пожалуйста, закройте PowerShell 7 и запустите скрип заново.
UnsupportedOSBuild = Скрипт поддерживает Windows 11 23H2 и выше. Ваша ОС {0}. UnsupportedOSBuild = Скрипт поддерживает Windows 11 23H2 и выше. Ваша ОС {0}.
UnsupportedWindowsTerminal = Версия Windows Terminal ниже 1.20. Пожалуйста, обновите его в Microsoft Store и попробуйте заново. UnsupportedWindowsTerminal = Версия Windows Terminal ниже 1.20. Пожалуйста, обновите его в Microsoft Store и попробуйте заново.
UpdateWarning = Ваш билд Windows 11: {0}.{1}. Поддерживаемые сборки: {2} и выше. Запустите обновление Windows и попробуйте заново. UpdateWarning = Ваш билд Windows 11: {0}.{1}. Поддерживаемые сборки: {2} и выше. Запустите обновление Windows и попробуйте заново.

3
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/tr-TR/Sophia.psd1

@ -1,5 +1,6 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBuild = Komut dosyası Windows 11 23H2 ve üstünü destekler. İşletim sisteminiz {0}. PowerShellImportFailed = Lütfen PowerShell 7 yi kapatın ve komut dosyasını yeniden çalıştırın.
UnsupportedOSBuild = Komut dosyası Windows 11 23H2 ve üstünü destekler. Sizin işletim sisteminiz {0}.
UnsupportedWindowsTerminal = Windows Terminal sürümü 1.20'den daha düşük. Lütfen Microsoft Store'da güncelleyin ve tekrar deneyin. UnsupportedWindowsTerminal = Windows Terminal sürümü 1.20'den daha düşük. Lütfen Microsoft Store'da güncelleyin ve tekrar deneyin.
UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapılar: {2} ve üzeri sürümler.. Windows Update'i çalıştırın ve tekrar deneyin. UpdateWarning = Windows 11 yapınız: {0}.{1}. Desteklenen yapılar: {2} ve üzeri sürümler.. Windows Update'i çalıştırın ve tekrar deneyin.
UnsupportedLanguageMode = Sınırlı bir dil modunda çalışan PowerShell oturumu. UnsupportedLanguageMode = Sınırlı bir dil modunda çalışan PowerShell oturumu.

1
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/uk-UA/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = Будь ласка, закрийте PowerShell 7 і запустіть сценарій знову.
UnsupportedOSBuild = Скрипт підтримує тільки Windows 11 23H2 і вище. Ваша ОС {0}. UnsupportedOSBuild = Скрипт підтримує тільки Windows 11 23H2 і вище. Ваша ОС {0}.
UnsupportedWindowsTerminal = Версія Windows Terminal нижча за 1.20. Будь ласка, оновіть його в Microsoft Store і спробуйте заново. UnsupportedWindowsTerminal = Версія Windows Terminal нижча за 1.20. Будь ласка, оновіть його в Microsoft Store і спробуйте заново.
UpdateWarning = Ваш білд Windows 11: {0}.{1}. Підтримувані збірки: {2} і вище.. Запустіть Windows Update і повторіть спробу. UpdateWarning = Ваш білд Windows 11: {0}.{1}. Підтримувані збірки: {2} і вище.. Запустіть Windows Update і повторіть спробу.

1
src/Sophia_Script_for_Windows_11_PowerShell_7/Localizations/zh-CN/Sophia.psd1

@ -1,4 +1,5 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
PowerShellImportFailed = 请关闭PowerShell 7并重新运行脚本
UnsupportedOSBuild = 腳本支援 Windows 11 23H2 及更高版本您的作業系統是 {0} UnsupportedOSBuild = 腳本支援 Windows 11 23H2 及更高版本您的作業系統是 {0}
UnsupportedWindowsTerminal = Windows Terminal版本低於1.20請在Microsoft商店更新後再試 UnsupportedWindowsTerminal = Windows Terminal版本低於1.20請在Microsoft商店更新後再試
UpdateWarning = 您的Windows 11构建: {0}.{1}支援的版本{2} 及更高版本运行Windows Update并再次尝试 UpdateWarning = 您的Windows 11构建: {0}.{1}支援的版本{2} 及更高版本运行Windows Update并再次尝试

113
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -67,7 +67,21 @@ function InitialActions
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Import PowerShell 5.1 modules # Import PowerShell 5.1 modules
Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx, DISM -UseWindowsPowerShell try
{
Import-Module -Name Microsoft.PowerShell.Management, PackageManagement, Appx, DISM -UseWindowsPowerShell -Force -ErrorAction Stop
}
catch
{
Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message $Localization.PowerShellImportFailed
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose
exit
}
# https://github.com/PowerShell/PowerShell/issues/21070 # https://github.com/PowerShell/PowerShell/issues/21070
$Script:CompilerOptions = [System.CodeDom.Compiler.CompilerParameters]::new("System.dll") $Script:CompilerOptions = [System.CodeDom.Compiler.CompilerParameters]::new("System.dll")
@ -509,16 +523,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
exit exit
} }
# Checking whether WMI is corrupted # Check Microsoft Defender state
try if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore))
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
catch [Microsoft.Management.Infrastructure.CimException]
{ {
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -530,9 +538,21 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
} }
# Check Microsoft Defender state # Check Microsoft Defender state
if ($null -eq (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 -ErrorAction Ignore)) try
{ {
$productState = (Get-CimInstance -ClassName AntiVirusProduct -Namespace root/SecurityCenter2 | Where-Object -FilterScript {$_.instanceGuid -eq "{D68DDC3A-831F-4fae-9E44-DA132C1ACF46}"}).productState
$DefenderState = ('0x{0:x}' -f $productState).Substring(3, 2)
# Defender is a currently used AV. Continue...
if ($DefenderState -notmatch "00|01")
{
Get-CimInstance -ClassName MSFT_MpComputerStatus -Namespace root/Microsoft/Windows/Defender -ErrorAction Stop | Out-Null
}
}
catch [Microsoft.Management.Infrastructure.CimException]
{
# Provider Load Failure exception
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
Write-Warning -Message ($Global:Error.Exception.Message | Select-Object -First 1)
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender")
Write-Information -MessageData "" -InformationAction Continue Write-Information -MessageData "" -InformationAction Continue
@ -567,7 +587,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
try try
{ {
$Script:DefenderMpPreferenceBroken = $false $Script:DefenderMpPreferenceBroken = $false
(Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess (Get-MpPreference -ErrorAction Stop).EnableControlledFolderAccess
} }
catch [System.Management.Automation.RemoteException] catch [System.Management.Automation.RemoteException]
{ {
@ -3074,7 +3094,7 @@ function QuickAccessRecentFiles
# Remove all policies in order to make changes visible in UI only if it's possible # Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer, HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer -Name NoRecentDocsHistory -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoRecentDocsHistory -Type CLEAR
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
@ -4691,14 +4711,14 @@ function StartRecommendedSection
New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -PropertyType DWord -Value 1 -Force New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -PropertyType DWord -Value 1 -Force
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1 Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Education -Name IsEducationEnvironment -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start -Name HideRecommendedSection -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\Start -Name HideRecommendedSection -Force -ErrorAction Ignore
Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR
} }
} }
} }
@ -5600,7 +5620,7 @@ function WindowsFeatures
[void]$Window.Close() [void]$Window.Close()
$SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose} $SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedFeatures | Enable-WindowsOptionalFeature -Online -NoRestart $SelectedFeatures | Enable-WindowsOptionalFeature -Online -All -NoRestart
} }
function Add-FeatureControl function Add-FeatureControl
@ -9117,7 +9137,7 @@ public static long MakeLong(uint left, uint right)
New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force New-ItemProperty -Path "HKCU:\Software\Classes\$ProgId\DefaultIcon" -Name "(default)" -PropertyType String -Value $Icon -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -Type DWord -Value 0 -Force New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts -Name "$($ProgID)_$($Extension)" -PropertyType DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -10102,7 +10122,7 @@ function RegistryBackup
{ {
"Enable" "Enable"
{ {
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -Type DWord -Value 1 -Force New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" -Name EnablePeriodicBackup -PropertyType DWord -Value 1 -Force
} }
"Disable" "Disable"
{ {
@ -11217,17 +11237,14 @@ function CleanupTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking whether VBS engine is enabled # Checking whether VBS engine is enabled
@ -11678,17 +11695,14 @@ function SoftwareDistributionTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking whether VBS engine is enabled # Checking whether VBS engine is enabled
@ -12017,17 +12031,14 @@ function TempTask
{ {
"Register" "Register"
{ {
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Remove registry keys if Windows Script Host is disabled
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Script Host\Settings", "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name Enabled -Force -ErrorAction Ignore
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Checking whether VBS engine is enabled # Checking whether VBS engine is enabled
@ -12210,7 +12221,8 @@ Get-ChildItem -Path `$env:TEMP -Recurse -Force | Where-Object -FilterScript {`$_
(-join ("`$env:SystemDrive\", '`$Windows.~WS')), (-join ("`$env:SystemDrive\", '`$Windows.~WS')),
"`$env:SystemDrive\ESD", "`$env:SystemDrive\ESD",
"`$env:SystemDrive\Intel", "`$env:SystemDrive\Intel",
"`$env:SystemDrive\PerfLogs" "`$env:SystemDrive\PerfLogs",
"`$env:SystemRoot\ServiceProfiles\NetworkService\AppData\Local\Temp"
) )
if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName) if ((Get-ChildItem -Path `$env:SystemDrive\Recovery -Force | Where-Object -FilterScript {`$_.Name -eq "ReAgentOld.xml"}).FullName)
@ -14279,23 +14291,16 @@ public static void PostMessage()
#endregion Other actions #endregion Other actions
#region Toast notifications #region Toast notifications
# Persist Sophia notifications to prevent to immediately disappear from Action Center
# Enable notifications in Action Center
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
# Enable notifications # Enable notifications
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications -Name ToastEnabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.ActionCenter.SmartOptOut -Name Enable -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowBanner, ShowInActionCenter, Enabled -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\SystemSettings\AccountNotifications -Name EnableAccountNotifications -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer, HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -Name NoToastApplicationNotification -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableNotificationCenter -Type CLEAR
if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia))
{
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Force
}
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Sophia -Name ShowInActionCenter -PropertyType DWord -Value 1 -Force
if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia)) if (-not (Test-Path -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia))
{ {
New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force New-Item -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Force

2
src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

@ -128,7 +128,7 @@ try
} }
catch [System.InvalidOperationException] catch [System.InvalidOperationException]
{ {
Write-Warning -Message $Localization.UnsupportedPowerShell Write-Warning -Message ($Localization.UnsupportedPowerShell -f $PSVersionTable.PSVersion.Major, $PSVersionTable.PSVersion.Minor)
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose
Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose

Loading…
Cancel
Save