@ -205,7 +205,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# https://www.youtube.com/GHOSTSPECTRE
" Ghost Toolbox " = " $ env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd "
# https://github.com/hellzerg/optimizer
Optimizer = " $( Get-ItemPropertyValue -Path `" HKCU : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Explorer \ User Shell Folders `" -Name `" { 374DE290 - 123F - 4565 - 9164 - 39C4925E467B } `" ) \OptimizerDownloads "
Optimizer = " $( Get-ItemPropertyValue -Path `" HKCU : \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ User Shell Folders `" -Name `" { 374DE290 - 123F - 4565 - 9164 - 39C4925E467B } `" ) \OptimizerDownloads "
# https://win10tweaker.ru
" Win 10 Tweaker " = " HKCU:\Software\Win 10 Tweaker "
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -1286,6 +1286,10 @@ function ErrorReporting
$Enable
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path " HKLM:\Software\Policies\Microsoft\Windows\Windows Error Reporting " -Name Disabled -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path " SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting " -Name Disabled -Type CLEAR
switch ( $PSCmdlet . ParameterSetName )
{
" Disable "
@ -1348,6 +1352,10 @@ function FeedbackFrequency
$Automatically
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM : \ SOFTWARE \ Policies \ Microsoft \ Windows \ DataCollection -Name DoNotShowFeedbackNotifications -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE \ Policies \ Microsoft \ Windows \ DataCollection -Name DoNotShowFeedbackNotifications -Type CLEAR
switch ( $PSCmdlet . ParameterSetName )
{
" Never "
@ -1357,10 +1365,12 @@ function FeedbackFrequency
New-Item -Path HKCU : \ Software \ Microsoft \ Siuf \ Rules -Force
}
New-ItemProperty -Path HKCU : \ Software \ Microsoft \ Siuf \ Rules -Name NumberOfSIUFInPeriod -PropertyType DWord -Value 0 -Force
Remove-ItemProperty -Path HKCU : \ SOFTWARE \ Microsoft \ Siuf \ Rules -Name PeriodInNanoSeconds -Force -ErrorAction Ignore
}
" Automatically "
{
Remove-Item -Path HKCU : \ Software \ Microsoft \ Siuf \ Rules -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKCU : \ SOFTWARE \ Microsoft \ Siuf \ Rules -Name PeriodInNanoSeconds , NumberOfSIUFInPeriod -Force -ErrorAction Ignore
}
}
}
@ -1718,6 +1728,10 @@ function SigninInfo
$Enable
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM : \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System -Name DisableAutomaticRestartSignOn -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System -Name DisableAutomaticRestartSignOn -Type CLEAR
switch ( $PSCmdlet . ParameterSetName )
{
" Disable "
@ -1826,6 +1840,10 @@ function AdvertisingID
$Enable
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM : \ SOFTWARE \ Policies \ Microsoft \ Windows \ AdvertisingInfo -Name DisabledByGroupPolicy -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE \ Policies \ Microsoft \ Windows \ DataCollection -Name DisabledByGroupPolicy -Type CLEAR
switch ( $PSCmdlet . ParameterSetName )
{
" Disable "
@ -1936,6 +1954,10 @@ function WindowsTips
$Enable
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM : \ SOFTWARE \ Policies \ Microsoft \ Windows \ CloudContent -Name DisableSoftLanding -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE \ Policies \ Microsoft \ Windows \ CloudContent -Name DisableSoftLanding -Type CLEAR
switch ( $PSCmdlet . ParameterSetName )
{
" Enable "
@ -2042,6 +2064,10 @@ function AppsSilentInstalling
$Enable
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM : \ Software \ Policies \ Microsoft \ Windows \ CloudContent -Name DisableWindowsConsumerFeatures -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE \ Policies \ Microsoft \ Windows \ CloudContent -Name DisableWindowsConsumerFeatures -Type CLEAR
switch ( $PSCmdlet . ParameterSetName )
{
" Disable "
@ -2152,6 +2178,10 @@ function TailoredExperiences
$Enable
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKCU : \ Software \ Policies \ Microsoft \ Windows \ CloudContent -Name DisableTailoredExperiencesWithDiagnosticData -Force -ErrorAction Ignore
Set-Policy -Scope User -Path Software \ Policies \ Microsoft \ Windows \ CloudContent -Name DisableTailoredExperiencesWithDiagnosticData -Type CLEAR
switch ( $PSCmdlet . ParameterSetName )
{
" Disable "
@ -4206,7 +4236,7 @@ function Cursors
return
}
$DownloadsFolder = Get-ItemPropertyValue -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$DownloadsFolder = Get-ItemPropertyValue -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$Parameters = @ {
Uri = " https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip "
OutFile = " $ DownloadsFolder\dark.zip "
@ -4242,10 +4272,8 @@ function Cursors
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name IBeam -PropertyType ExpandString -Value " %SystemRoot%\Cursors\W11_dark_v2.2\beam.cur " -Force
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name No -PropertyType ExpandString -Value " %SystemRoot%\Cursors\W11_dark_v2.2\unavailable.cur " -Force
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name NWPen -PropertyType ExpandString -Value " %SystemRoot%\Cursors\W11_dark_v2.2\handwriting.cur " -Force
# This is not a typo
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name Person -PropertyType ExpandString -Value " %SystemRoot%\Cursors\W11_dark_v2.2\pin.cur " -Force
# This is not a typo
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name Pin -PropertyType ExpandString -Value " %SystemRoot%\Cursors\W11_dark_v2.2\person.cur " -Force
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name Person -PropertyType ExpandString -Value " %SystemRoot%\Cursors\W11_dark_v2.2\person.cur " -Force
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name Pin -PropertyType ExpandString -Value " %SystemRoot%\Cursors\W11_dark_v2.2\pin.cur " -Force
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name precisionhair -PropertyType ExpandString -Value " %SystemRoot%\Cursors\W11_dark_v2.2\precision.cur " -Force
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name " Scheme Source " -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path " HKCU:\Control Panel\Cursors " -Name SizeAll -PropertyType ExpandString -Value " %SystemRoot%\Cursors\W11_dark_v2.2\move.cur " -Force
@ -4334,7 +4362,7 @@ function Cursors
return
}
$DownloadsFolder = Get-ItemPropertyValue -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$DownloadsFolder = Get-ItemPropertyValue -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders " -Name " {374DE290-123F-4565-9164-39C4925E467B} "
$Parameters = @ {
Uri = " https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip "
OutFile = " $ DownloadsFolder\light.zip "
@ -9187,9 +9215,9 @@ public static int UnloadHive(RegistryHives hive, string subKey)
Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore
[array] $UserRegisteredProgIDs = @ ( )
foreach ( $Item in ( Get-Item -Path " HKCU:\SOFTWARE \RegisteredApplications " ) . Property )
foreach ( $Item in ( Get-Item -Path " HKCU:\Software \RegisteredApplications " ) . Property )
{
$Subkey = ( Get-ItemProperty -Path " HKCU:\SOFTWARE \RegisteredApplications " -Name $Item -ErrorAction Ignore ) . $Item
$Subkey = ( Get-ItemProperty -Path " HKCU:\Software \RegisteredApplications " -Name $Item -ErrorAction Ignore ) . $Item
if ( $Subkey )
{
if ( Test-Path -Path " HKCU:\ $ Subkey\ $ Associations " )
@ -9460,7 +9488,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 \ Microsoft \ Windows \ CurrentVersion \ ApplicationAssociationToasts -Name " $( $ProgID ) _ $( $Extension ) " -Type DWord -Value 0 -Force
New-ItemProperty -Path HKCU : \ Software \ Microsoft \ Windows \ CurrentVersion \ ApplicationAssociationToasts -Name " $( $ProgID ) _ $( $Extension ) " -Type DWord -Value 0 -Force
if ( $Extension . Contains ( " . " ) )
{
@ -9555,7 +9583,7 @@ function Export-Associations
# ProgrammPath
if ( [Microsoft.Win32.Registry] :: GetValue ( " HKEY_CURRENT_USER\Software\Classes\ $( $_ . ProgId ) \shell\open\command " , " " , $null ) )
{
$PartProgramPath = ( Get-ItemPropertyValue -Path " HKCU:\SOFTWARE \Classes\ $( $_ . ProgId ) \Shell\Open\Command " -Name " (default) " ) . Trim ( )
$PartProgramPath = ( Get-ItemPropertyValue -Path " HKCU:\Software \Classes\ $( $_ . ProgId ) \Shell\Open\Command " -Name " (default) " ) . Trim ( )
$Program = $PartProgramPath . Substring ( 0 , ( $PartProgramPath . IndexOf ( " .exe " ) + 4 ) ) . Trim ( '"' )
if ( $Program )
@ -13261,7 +13289,7 @@ function EventViewerCustomView
}
# Save ProcessCreation.xml in the UTF-8 with BOM encoding
Set-Content -Path " $ env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml " -Value $XML -Encoding UTF8 -NoNewline -Force ###
Set-Content -Path " $ env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml " -Value $XML -Encoding UTF8 -NoNewline -Force
}
" Disable "
{
@ -13834,7 +13862,7 @@ function DNSoverHTTPS
Local Security Authority protection
. PARAMETER Enable
Enable Local Security Authority protection to prevent code injection without UEFI lock ###
Enable Local Security Authority protection to prevent code injection without UEFI lock
. PARAMETER Disable
Disable Local Security Authority protection
@ -13900,9 +13928,9 @@ function LocalSecurityAuthority
" Disable "
{
Remove-ItemProperty -Path HKLM : \ SYSTEM \ CurrentControlSet \ Control \ Lsa -Name RunAsPPL , RunAsPPLBoot -Force -ErrorAction Ignore
Remove-ItemProperty -Path HKLM : \ SOFTWARE \ Policies \ Microsoft \ Windows \ System -Name RunAsPPL -Force -ErrorAction Ignore ###
Remove-ItemProperty -Path HKLM : \ SOFTWARE \ Policies \ Microsoft \ Windows \ System -Name RunAsPPL -Force -ErrorAction Ignore
Set-Policy -Scope Us er -Path Software \ Policies \ Microsoft \ Windows \ Explorer -Name NoUseStoreOpenWith -Type CLEAR
Set-Policy -Scope Comput er -Path Software \ Policies \ Microsoft \ Windows \ Explorer -Name RunAsPPL -Type CLEAR
}
}
}
@ -14074,15 +14102,15 @@ function EditWithClipchampContext
{
" Hide "
{
if ( -not ( Test-Path -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " ) )
if ( -not ( Test-Path -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " ) )
{
New-Item -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Force
New-Item -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Force
}
New-ItemProperty -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {8AB635F8-9A67-4698-AB99-784AD929F3B4} " -PropertyType String -Value " " -Force
New-ItemProperty -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {8AB635F8-9A67-4698-AB99-784AD929F3B4} " -PropertyType String -Value " " -Force
}
" Show "
{
Remove-ItemProperty -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {8AB635F8-9A67-4698-AB99-784AD929F3B4} " -Force -ErrorAction Ignore
Remove-ItemProperty -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {8AB635F8-9A67-4698-AB99-784AD929F3B4} " -Force -ErrorAction Ignore
}
}
}
@ -14354,15 +14382,15 @@ function OpenWindowsTerminalContext
{
" Show "
{
Remove-ItemProperty -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {9F156763-7844-4DC4-B2B1-901F640F5155} " -Force -ErrorAction Ignore
Remove-ItemProperty -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {9F156763-7844-4DC4-B2B1-901F640F5155} " -Force -ErrorAction Ignore
}
" Hide "
{
if ( -not ( Test-Path -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " ) )
if ( -not ( Test-Path -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " ) )
{
New-Item -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Force
New-Item -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Force
}
New-ItemProperty -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {9F156763-7844-4DC4-B2B1-901F640F5155} " -PropertyType String -Value " " -Force
New-ItemProperty -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {9F156763-7844-4DC4-B2B1-901F640F5155} " -PropertyType String -Value " " -Force
}
}
}
@ -14437,7 +14465,7 @@ function OpenWindowsTerminalAdminContext
{
" Enable "
{
Remove-ItemProperty -Path " HKCU:\SOFTWARE \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {9F156763-7844-4DC4-B2B1-901F640F5155} " -ErrorAction Ignore
Remove-ItemProperty -Path " HKCU:\Software \Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {9F156763-7844-4DC4-B2B1-901F640F5155} " -ErrorAction Ignore
Remove-ItemProperty -Path " HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked " -Name " {9F156763-7844-4DC4-B2B1-901F640F5155} " -ErrorAction Ignore
if ( $Terminal . profiles . defaults . elevate )