|
@ -159,7 +159,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
# Check the language mode |
|
|
# Check the language mode |
|
|
if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") |
|
|
if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message $Localization.UnsupportedLanguageMode |
|
|
Write-Warning -Message $Localization.UnsupportedLanguageMode |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
Write-Verbose -Message "https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes" -Verbose |
|
|
Write-Verbose -Message "https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes" -Verbose |
|
|
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose |
|
|
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose |
|
@ -175,7 +177,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
|
|
|
|
|
|
if ($CurrentUserName -ne $LoginUserName) |
|
|
if ($CurrentUserName -ne $LoginUserName) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message $Localization.LoggedInUserNotAdmin |
|
|
Write-Warning -Message $Localization.LoggedInUserNotAdmin |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -186,7 +190,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
# Check whether the script was run via PowerShell 5.1 |
|
|
# Check whether the script was run via PowerShell 5.1 |
|
|
if ($PSVersionTable.PSVersion.Major -ne 5) |
|
|
if ($PSVersionTable.PSVersion.Major -ne 5) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.UnsupportedPowerShell -f $PSVersionTable.PSVersion.Major, $PSVersionTable.PSVersion.Minor) |
|
|
Write-Warning -Message ($Localization.UnsupportedPowerShell -f $PSVersionTable.PSVersion.Major, $PSVersionTable.PSVersion.Minor) |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -197,7 +203,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
# Check whether the script was run in PowerShell ISE or VS Code |
|
|
# Check whether the script was run in PowerShell ISE or VS Code |
|
|
if (($Host.Name -match "ISE") -or ($env:TERM_PROGRAM -eq "vscode")) |
|
|
if (($Host.Name -match "ISE") -or ($env:TERM_PROGRAM -eq "vscode")) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.UnsupportedHost -f $Host.Name.Replace("Host", "")) |
|
|
Write-Warning -Message ($Localization.UnsupportedHost -f $Host.Name.Replace("Host", "")) |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -248,7 +256,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
{ |
|
|
{ |
|
|
if ($Tweakers[$Tweaker] -eq "HKCU:\Software\Win 10 Tweaker") |
|
|
if ($Tweakers[$Tweaker] -eq "HKCU:\Software\Win 10 Tweaker") |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message $Localization.Win10TweakerWarning |
|
|
Write-Warning -Message $Localization.Win10TweakerWarning |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
Write-Verbose -Message "https://youtu.be/na93MS-1EkM" -Verbose |
|
|
Write-Verbose -Message "https://youtu.be/na93MS-1EkM" -Verbose |
|
|
Write-Verbose -Message "https://pikabu.ru/story/byekdor_v_win_10_tweaker_ili_sovremennyie_metodyi_borbyi_s_piratstvom_8227558" -Verbose |
|
|
Write-Verbose -Message "https://pikabu.ru/story/byekdor_v_win_10_tweaker_ili_sovremennyie_metodyi_borbyi_s_piratstvom_8227558" -Verbose |
|
@ -258,7 +268,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
exit |
|
|
exit |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.TweakerWarning -f $Tweaker) |
|
|
Write-Warning -Message ($Localization.TweakerWarning -f $Tweaker) |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -278,7 +290,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
{ |
|
|
{ |
|
|
if ($Tweakers[$Tweaker]) |
|
|
if ($Tweakers[$Tweaker]) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.TweakerWarning -f $Tweaker) |
|
|
Write-Warning -Message ($Localization.TweakerWarning -f $Tweaker) |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -288,20 +302,26 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Check whether Get-WindowsEdition cmdlet is working |
|
|
# Check whether Get-WindowsEdition cmdlet is working |
|
|
|
|
|
# https://github.com/PowerShell/PowerShell/issues/21295 |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
Get-WindowsEdition -Online |
|
|
Get-WindowsEdition -Online |
|
|
} |
|
|
} |
|
|
catch [System.Runtime.InteropServices.COMException] |
|
|
catch [System.Runtime.InteropServices.COMException] |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Get-WindowsEdition") |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Get-WindowsEdition") |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
exit |
|
|
exit |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
# Check whether Windows Feature Experience Pack was removed by harmful tweakers |
|
|
# Check whether Windows Feature Experience Pack was removed by harmful tweakers |
|
|
if (-not (Get-AppxPackage -Name MicrosoftWindows.Client.CBS)) |
|
|
if (-not (Get-AppxPackage -Name MicrosoftWindows.Client.CBS)) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Windows Feature Experience Pack") |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Windows Feature Experience Pack") |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -312,8 +332,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
# Check whether EventLog service is running in order to be sire that Event Logger is enabled |
|
|
# Check whether EventLog service is running in order to be sire that Event Logger is enabled |
|
|
if ((Get-Service -Name EventLog).Status -eq "Stopped") |
|
|
if ((Get-Service -Name EventLog).Status -eq "Stopped") |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
# Extract the localized "Event Viewer" string from shell32.dll |
|
|
# Extract the localized "Event Viewer" string from shell32.dll |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f $([WinAPI.GetStrings]::GetString(22029))) |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f $([WinAPI.GetStrings]::GetString(22029))) |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -324,7 +346,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
# Check whether Microsoft Store being an important system component was removed |
|
|
# Check whether Microsoft Store being an important system component was removed |
|
|
if (-not (Get-AppxPackage -Name Microsoft.WindowsStore)) |
|
|
if (-not (Get-AppxPackage -Name Microsoft.WindowsStore)) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Store") |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Store") |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -343,7 +367,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
{ |
|
|
{ |
|
|
if (-not (Test-Path -Path $File)) |
|
|
if (-not (Test-Path -Path $File)) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f $File) |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f $File) |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose |
|
|
Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose |
|
|
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose |
|
|
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose |
|
@ -356,7 +382,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
# Checking whether Windows Security Settings page was hidden from UI |
|
|
# Checking whether Windows Security Settings page was hidden from UI |
|
|
if ([Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer", "SettingsPageVisibility", $null) -match "hide:windowsdefender") |
|
|
if ([Microsoft.Win32.Registry]::GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer", "SettingsPageVisibility", $null) -match "hide:windowsdefender") |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -372,8 +400,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
catch [Microsoft.Management.Infrastructure.CimException] |
|
|
catch [Microsoft.Management.Infrastructure.CimException] |
|
|
{ |
|
|
{ |
|
|
# Provider Load Failure exception |
|
|
# Provider Load Failure exception |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message $Global:Error.Exception.Message | Select-Object -First 1 |
|
|
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-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 |
|
@ -384,7 +414,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
# Check Microsoft Defender state |
|
|
# Check Microsoft Defender state |
|
|
if ($null -eq (Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntiVirusProduct -ErrorAction Ignore)) |
|
|
if ($null -eq (Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntiVirusProduct -ErrorAction Ignore)) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -400,7 +432,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
} |
|
|
} |
|
|
catch [Microsoft.PowerShell.Commands.ServiceCommandException] |
|
|
catch [Microsoft.PowerShell.Commands.ServiceCommandException] |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") |
|
|
Write-Warning -Message ($Localization.WindowsComponentBroken -f "Microsoft Defender") |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -505,7 +539,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
) |
|
|
) |
|
|
if (($PendingActions | Test-Path) -contains $true) |
|
|
if (($PendingActions | Test-Path) -contains $true) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message $Localization.RebootPending |
|
|
Write-Warning -Message $Localization.RebootPending |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -541,7 +577,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
|
|
|
|
|
|
if ([System.Version]$LatestRelease -gt [System.Version]$CurrentRelease) |
|
|
if ([System.Version]$LatestRelease -gt [System.Version]$CurrentRelease) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message $Localization.UnsupportedRelease |
|
|
Write-Warning -Message $Localization.UnsupportedRelease |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose |
|
|
Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose |
|
|
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose |
|
|
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose |
|
@ -565,7 +603,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
# Check whether LGPO.exe exists in the bin folder |
|
|
# Check whether LGPO.exe exists in the bin folder |
|
|
if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe")) |
|
|
if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe")) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message $Localization.Bin |
|
|
Write-Warning -Message $Localization.Bin |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose |
|
|
Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose |
|
|
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose |
|
|
Write-Verbose -Message "https://t.me/sophia_chat" -Verbose |
|
@ -579,7 +619,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
{ |
|
|
{ |
|
|
{$_ -ne 19045} |
|
|
{$_ -ne 19045} |
|
|
{ |
|
|
{ |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message $Localization.UnsupportedOSBuild |
|
|
Write-Warning -Message $Localization.UnsupportedOSBuild |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -647,7 +689,9 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); |
|
|
# https://support.microsoft.com/en-us/topic/windows-10-update-history-8127c2c6-6edf-4fdf-8b9f-0f7be1ef3562 |
|
|
# https://support.microsoft.com/en-us/topic/windows-10-update-history-8127c2c6-6edf-4fdf-8b9f-0f7be1ef3562 |
|
|
$CurrentBuild = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name CurrentBuild |
|
|
$CurrentBuild = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name CurrentBuild |
|
|
$UBR = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR |
|
|
$UBR = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Warning -Message ($Localization.UpdateWarning -f $CurrentBuild.CurrentBuild, $UBR.UBR, $LatestSupportedBuild) |
|
|
Write-Warning -Message ($Localization.UpdateWarning -f $CurrentBuild.CurrentBuild, $UBR.UBR, $LatestSupportedBuild) |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -1173,6 +1217,7 @@ function DiagTrackService |
|
|
$PresetName = Split-Path -Path (((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_.EndsWith(".ps1")}) -Leaf |
|
|
$PresetName = Split-Path -Path (((Get-PSCallStack).Position | Where-Object -FilterScript {$_.File}).File | Where-Object -FilterScript {$_.EndsWith(".ps1")}) -Leaf |
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
Write-Verbose -Message ($Localization.InitialActionsCheckFailed -f $PresetName) -Verbose |
|
|
Write-Verbose -Message ($Localization.InitialActionsCheckFailed -f $PresetName) -Verbose |
|
|
|
|
|
Write-Information -MessageData "" -InformationAction Continue |
|
|
|
|
|
|
|
|
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 |
|
@ -11559,8 +11604,8 @@ function UninstallUWPApps |
|
|
# Outlook |
|
|
# Outlook |
|
|
"Microsoft.OutlookForWindows", |
|
|
"Microsoft.OutlookForWindows", |
|
|
|
|
|
|
|
|
# Chat (Microsoft Teams) |
|
|
# Microsoft Teams |
|
|
"MicrosoftTeams", |
|
|
"MSTeams", |
|
|
|
|
|
|
|
|
# Microsoft Copilot |
|
|
# Microsoft Copilot |
|
|
"Microsoft.Windows.Ai.CoPilot.Provider" |
|
|
"Microsoft.Windows.Ai.CoPilot.Provider" |
|
@ -12826,7 +12871,7 @@ while (`$true) |
|
|
[int]`$CurrentMainWindowHandle = (Get-Process -Name cleanmgr | Where-Object -FilterScript {`$_.PriorityClass -eq """BelowNormal"""}).MainWindowHandle |
|
|
[int]`$CurrentMainWindowHandle = (Get-Process -Name cleanmgr | Where-Object -FilterScript {`$_.PriorityClass -eq """BelowNormal"""}).MainWindowHandle |
|
|
if (`$SourceMainWindowHandle -ne `$CurrentMainWindowHandle) |
|
|
if (`$SourceMainWindowHandle -ne `$CurrentMainWindowHandle) |
|
|
{ |
|
|
{ |
|
|
`$CompilerParameters = [System.CodeDom.Compiler.CompilerParameters]::new("System.dll") |
|
|
`$CompilerParameters = [System.CodeDom.Compiler.CompilerParameters]::new("""System.dll""") |
|
|
`$CompilerParameters.TempFiles = [System.CodeDom.Compiler.TempFileCollection]::new(`$env:TEMP, `$false) |
|
|
`$CompilerParameters.TempFiles = [System.CodeDom.Compiler.TempFileCollection]::new(`$env:TEMP, `$false) |
|
|
`$CompilerParameters.GenerateInMemory = `$true |
|
|
`$CompilerParameters.GenerateInMemory = `$true |
|
|
`$Signature = @{ |
|
|
`$Signature = @{ |
|
@ -12892,7 +12937,7 @@ public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); |
|
|
# https://github.com/DCourtel/Windows_10_Focus_Assist/blob/master/FocusAssistLibrary/FocusAssistLib.cs |
|
|
# https://github.com/DCourtel/Windows_10_Focus_Assist/blob/master/FocusAssistLibrary/FocusAssistLib.cs |
|
|
# https://redplait.blogspot.com/2018/07/wnf-ids-from-perfntcdll-adk-version.html |
|
|
# https://redplait.blogspot.com/2018/07/wnf-ids-from-perfntcdll-adk-version.html |
|
|
|
|
|
|
|
|
`$CompilerParameters = [System.CodeDom.Compiler.CompilerParameters]::new("System.dll") |
|
|
`$CompilerParameters = [System.CodeDom.Compiler.CompilerParameters]::new("""System.dll""") |
|
|
`$CompilerParameters.TempFiles = [System.CodeDom.Compiler.TempFileCollection]::new(`$env:TEMP, `$false) |
|
|
`$CompilerParameters.TempFiles = [System.CodeDom.Compiler.TempFileCollection]::new(`$env:TEMP, `$false) |
|
|
`$CompilerParameters.GenerateInMemory = `$true |
|
|
`$CompilerParameters.GenerateInMemory = `$true |
|
|
`$Signature = @{ |
|
|
`$Signature = @{ |
|
@ -13213,7 +13258,7 @@ function SoftwareDistributionTask |
|
|
# https://github.com/DCourtel/Windows_10_Focus_Assist/blob/master/FocusAssistLibrary/FocusAssistLib.cs |
|
|
# https://github.com/DCourtel/Windows_10_Focus_Assist/blob/master/FocusAssistLibrary/FocusAssistLib.cs |
|
|
# https://redplait.blogspot.com/2018/07/wnf-ids-from-perfntcdll-adk-version.html |
|
|
# https://redplait.blogspot.com/2018/07/wnf-ids-from-perfntcdll-adk-version.html |
|
|
|
|
|
|
|
|
`$CompilerParameters = [System.CodeDom.Compiler.CompilerParameters]::new("System.dll") |
|
|
`$CompilerParameters = [System.CodeDom.Compiler.CompilerParameters]::new("""System.dll""") |
|
|
`$CompilerParameters.TempFiles = [System.CodeDom.Compiler.TempFileCollection]::new(`$env:TEMP, `$false) |
|
|
`$CompilerParameters.TempFiles = [System.CodeDom.Compiler.TempFileCollection]::new(`$env:TEMP, `$false) |
|
|
`$CompilerParameters.GenerateInMemory = `$true |
|
|
`$CompilerParameters.GenerateInMemory = `$true |
|
|
`$Signature = @{ |
|
|
`$Signature = @{ |
|
@ -13523,7 +13568,7 @@ function TempTask |
|
|
# https://github.com/DCourtel/Windows_10_Focus_Assist/blob/master/FocusAssistLibrary/FocusAssistLib.cs |
|
|
# https://github.com/DCourtel/Windows_10_Focus_Assist/blob/master/FocusAssistLibrary/FocusAssistLib.cs |
|
|
# https://redplait.blogspot.com/2018/07/wnf-ids-from-perfntcdll-adk-version.html |
|
|
# https://redplait.blogspot.com/2018/07/wnf-ids-from-perfntcdll-adk-version.html |
|
|
|
|
|
|
|
|
`$CompilerParameters = [System.CodeDom.Compiler.CompilerParameters]::new("System.dll") |
|
|
`$CompilerParameters = [System.CodeDom.Compiler.CompilerParameters]::new("""System.dll""") |
|
|
`$CompilerParameters.TempFiles = [System.CodeDom.Compiler.TempFileCollection]::new(`$env:TEMP, `$false) |
|
|
`$CompilerParameters.TempFiles = [System.CodeDom.Compiler.TempFileCollection]::new(`$env:TEMP, `$false) |
|
|
`$CompilerParameters.GenerateInMemory = `$true |
|
|
`$CompilerParameters.GenerateInMemory = `$true |
|
|
`$Signature = @{ |
|
|
`$Signature = @{ |
|
@ -15409,12 +15454,6 @@ public static void PostMessage() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($Script:RegionChanged) |
|
|
|
|
|
{ |
|
|
|
|
|
# Set the original region ID |
|
|
|
|
|
Set-WinHomeLocation -GeoId $Script:Region |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database |
|
|
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database |
|
|
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) |
|
|
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt")) |
|
|
{ |
|
|
{ |
|
|