@ -300,6 +300,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . TweakerWarning -f $Tweaker )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -435,6 +436,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Windows Feature Experience Pack " )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -449,6 +451,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . WindowsComponentBroken -f $ ( [WinAPI.GetStrings] :: GetString ( 22029 ) ) )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -462,6 +465,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Microsoft Store " )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -483,6 +487,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . WindowsComponentBroken -f $File )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -497,6 +502,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Microsoft Defender " )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -516,6 +522,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Microsoft Defender " )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -529,6 +536,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Microsoft Defender " )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -547,6 +555,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Microsoft Defender " )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -565,6 +574,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
Write-Warning -Message ( $Localization . WindowsComponentBroken -f " Microsoft Defender " )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -580,7 +590,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
$Script:DefenderProductState = $true
# Checking whether Microsoft Defender was turned off via GPO
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender " , " DisableAntiSpyware " , $null ) -eq 1 )
{
$Script:AntiSpywareEnabled = $false
@ -591,7 +601,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
}
# Checking whether Microsoft Defender was turned off via GPO
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection " , " DisableRealtimeMonitoring " , $null ) -eq 1 )
{
$Script:RealtimeMonitoringEnabled = $false
@ -602,7 +612,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
}
# Checking whether Microsoft Defender was turned off via GPO
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection " , " DisableBehaviorMonitoring " , $null ) -eq 1 )
{
$Script:BehaviorMonitoringEnabled = $false
@ -3390,7 +3400,7 @@ function SearchHighlights
" Hide "
{
# Checking whether "Ask Copilot" and "Find results in Web" were disabled. They also disable Search Highlights automatically
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
$BingSearchEnabled = ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search " , " BingSearchEnabled " , $null ) )
$DisableSearchBoxSuggestions = ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer " , " DisableSearchBoxSuggestions " , $null ) )
if ( ( $BingSearchEnabled -eq 1 ) -or ( $DisableSearchBoxSuggestions -eq 1 ) )
@ -6464,7 +6474,7 @@ function NetworkAdaptersSavePower
$InterfaceIndex = ( Get-CimInstance -ClassName Win32_NetworkAdapter -Namespace root / CIMV2 | Where-Object -FilterScript { $_ . NetConnectionStatus -eq 2 } ) . InterfaceIndex
if ( Get-NetAdapter -Physical | Where-Object -FilterScript { ( $_ . Status -eq " Up " ) -and ( $_ . PhysicalMediaType -eq " Native 802.11 " ) -and ( $_ . InterfaceIndex -eq $InterfaceIndex ) } )
{
# Get C urrently connected Wi-Fi network SSID
# Get c urrently connected Wi-Fi network SSID
$SSID = ( Get-NetConnectionProfile ) . Name
}
@ -8589,7 +8599,7 @@ public static int UnloadHive(RegistryHives hive, string subKey)
$Extension
)
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
$OrigProgID = [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ $ Extension " , " " , $null )
if ( $OrigProgID )
{
@ -8597,7 +8607,7 @@ public static int UnloadHive(RegistryHives hive, string subKey)
$Script:RegisteredProgIDs + = $OrigProgID
}
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ $ Extension " , " " , $null ) -ne " " )
{
# Save possible ProgIds history with extension
@ -8613,7 +8623,7 @@ public static int UnloadHive(RegistryHives hive, string subKey)
}
# If ProgId doesn't exist set the specified ProgId for the extensions
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( -not [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ $ Extension " , " " , $null ) )
{
if ( -not ( Test-Path -Path " HKCU:\Software\Classes\ $ Extension " ) )
@ -8631,7 +8641,7 @@ public static int UnloadHive(RegistryHives hive, string subKey)
New-ItemProperty -Path " HKCU:\Software\Classes\ $ Extension\OpenWithProgids " -Name $ProgId -PropertyType None -Value ( [byte[]] @ ( ) ) -Force
# Set the system ProgId to the extension parameters for File Explorer to the possible options for the assignment, and if absent set the specified ProgId
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( $OrigProgID )
{
if ( -not ( Test-Path -Path " HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ $ Extension\OpenWithProgids " ) )
@ -8699,7 +8709,7 @@ public static int UnloadHive(RegistryHives hive, string subKey)
}
# Setting a block on changing the UserChoice section
# Due to "Set-StrictMode -Version Latest" we have to use OpenSubKey()
# We have to use OpenSubKey() due to "Set-StrictMode -Version Latest"
$OpenSubKey = [Microsoft.Win32.Registry] :: CurrentUser . OpenSubKey ( " Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ $ Extension\UserChoice " , " ReadWriteSubTree " , " TakeOwnership " )
if ( $OpenSubKey )
{
@ -8732,7 +8742,7 @@ public static int UnloadHive(RegistryHives hive, string subKey)
)
# If there is the system extension ProgId, write it to the already configured by default
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ $ Extension " , " " , $null ) )
{
if ( -not ( Test-Path -Path Registry :: HKEY_USERS \ . DEFAULT \ Software \ Microsoft \ Windows \ CurrentVersion \ FileAssociations \ ProgIds ) )
@ -8743,7 +8753,7 @@ public static int UnloadHive(RegistryHives hive, string subKey)
}
# Setting 'NoOpenWith' for all registered the extension ProgIDs
# Due to "Set-StrictMode -Version Latest" we have to check everything
# We have to check everything due to "Set-StrictMode -Version Latest"
if ( Get-Item -Path " Registry::HKEY_CLASSES_ROOT\ $ Extension\OpenWithProgids " -ErrorAction Ignore )
{
[psobject] $OpenSubkey = ( Get-Item -Path " Registry::HKEY_CLASSES_ROOT\ $ Extension\OpenWithProgids " -ErrorAction Ignore ) . Property
@ -8772,18 +8782,18 @@ public static int UnloadHive(RegistryHives hive, string subKey)
}
}
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\KindMap " , $Extension , $null ) )
{
$picture = ( Get-ItemProperty -Path HKLM : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Explorer \ KindMap -Name $Extension -ErrorAction Ignore ) . $Extension
}
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Classes\PBrush\CLSID " , " " , $null ) )
{
$PBrush = ( Get-ItemProperty -Path HKLM : \ SOFTWARE \ Classes \ PBrush \ CLSID -Name " (default) " -ErrorAction Ignore ) . " (default) "
}
# Due to "Set-StrictMode -Version Latest" we have to check everything
# We have to check everything due to "Set-StrictMode -Version Latest"
if ( Get-Variable -Name picture -ErrorAction Ignore )
{
if ( ( $picture -eq " picture " ) -and $PBrush )
@ -8792,7 +8802,7 @@ public static int UnloadHive(RegistryHives hive, string subKey)
}
}
# Due to "Set-StrictMode -Version Latest" we have to use GetValue()
# We have to use GetValue() due to "Set-StrictMode -Version Latest"
if ( ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\KindMap " , $Extension , $null ) ) -eq " picture " )
{
$Script:RegisteredProgIDs + = " PBrush "
@ -10891,7 +10901,7 @@ function CortanaAutostart
#region Gaming
<#
. SYNOPSIS
Game Bar
Xbox Game Bar
. PARAMETER Disable
Disable Xbox Game Bar
@ -10906,7 +10916,7 @@ function CortanaAutostart
XboxGameBar -Enable
. NOTES
To prevent popping up the " You'll need a new app to open this ms-gamingoverlay " warning , you need to disable the Game Bar app , even if you uninstalled it before
To prevent popping up the " You'll need a new app to open this ms-gamingoverlay " warning , you need to disable the Xbox Game Bar app , even if you uninstalled it before
. NOTES
Current user
@ -11205,6 +11215,7 @@ function CleanupTask
Write-Warning -Message ( $Localization . WindowsComponentBroken -f ( Get-WindowsCapability -Online -Name VBSCRIPT * ) . DisplayName )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -11665,6 +11676,7 @@ function SoftwareDistributionTask
Write-Warning -Message ( $Localization . WindowsComponentBroken -f ( Get-WindowsCapability -Online -Name VBSCRIPT * ) . DisplayName )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -12003,6 +12015,7 @@ function TempTask
Write-Warning -Message ( $Localization . WindowsComponentBroken -f ( Get-WindowsCapability -Online -Name VBSCRIPT * ) . DisplayName )
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message " https://www.microsoft.com/software-download/windows11 " -Verbose
Write-Verbose -Message " https://t.me/sophia_chat " -Verbose
Write-Verbose -Message " https://discord.gg/sSryhaEv79 " -Verbose
@ -12874,6 +12887,10 @@ function WindowsScriptHost
# Skip if a scheduled task exists
if ( $_ . State -eq " Ready " )
{
Write-Information -MessageData " " -InformationAction Continue
Write-Verbose -Message ( $Localization . Skipped -f $MyInvocation . Line . Trim ( ) ) -Verbose
Write-Error -Message ( $Localization . Skipped -f $MyInvocation . Line . Trim ( ) ) -ErrorAction SilentlyContinue
break
}
}
@ -14130,7 +14147,7 @@ public static void PostMessage()
}
}
# 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 because 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 " )
@ -14175,7 +14192,7 @@ public static void PostMessage()
$taskschd_Process_ID = ( Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript { $_ . Name -eq " mmc.exe " } | Where-Object -FilterScript {
$_ . CommandLine -match " taskschd.msc "
} ) . Handle
# Due to "Set-StrictMode -Version Latest" we have to check before executing
# We have to check before executing due to "Set-StrictMode -Version Latest"
if ( $taskschd_Process_ID )
{
Get-Process -Id $taskschd_Process_ID | Stop-Process -Force