Browse Source

Improved privacy related functions

master
Dmitry Nefedov 8 months ago
parent
commit
a3006f23af
  1. 4
      Wrapper/Localizations/de-DE/tooltip_Windows_11.json
  2. 4
      Wrapper/Localizations/en-US/tooltip_Windows_11.json
  3. 2
      Wrapper/Localizations/ru-RU/tooltip_Windows_11.json
  4. 74
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  5. 58
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  6. 64
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  7. 72
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  8. 78
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  9. 77
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

4
Wrapper/Localizations/de-DE/tooltip_Windows_11.json

@ -1839,11 +1839,11 @@
"Arg": { "Arg": {
"Zero": { "Zero": {
"Tag": "Enable", "Tag": "Enable",
"ToolTip": "Aktivieren Sie einen zusätzlichen Schutz für den LSA-Prozess (Local Security Authority), um die Einspeisung von Code zu verhindern, der Anmeldeinformationen gefährden könnte." "ToolTip": "Aktivieren Sie den Schutz der lokalen Sicherheitsbehörde, um Code-Injektion ohne UEFI-Sperre zu verhindern."
}, },
"One": { "One": {
"Tag": "Disable", "Tag": "Disable",
"ToolTip": "Deaktivieren Sie den Schutz der lokalen Sicherheitsbehörde (Standardeinstellung)." "ToolTip": "Deaktivieren Sie den Schutz der lokalen Sicherheitsbehörde ohne UEFI-Sperre (Standardeinstellung)."
} }
} }
}, },

4
Wrapper/Localizations/en-US/tooltip_Windows_11.json

@ -1839,11 +1839,11 @@
"Arg": { "Arg": {
"Zero": { "Zero": {
"Tag": "Enable", "Tag": "Enable",
"ToolTip": "Enable Local Security Authority protection to prevent code injection." "ToolTip": "Enable Local Security Authority protection to prevent code injection without UEFI lock."
}, },
"One": { "One": {
"Tag": "Disable", "Tag": "Disable",
"ToolTip": "Disable Local Security Authority protection (default value)." "ToolTip": "Disable Local Security Authority protection without UEFI lock (default value)."
} }
} }
}, },

2
Wrapper/Localizations/ru-RU/tooltip_Windows_11.json

@ -1839,7 +1839,7 @@
"Arg": { "Arg": {
"Zero": { "Zero": {
"Tag": "Enable", "Tag": "Enable",
"ToolTip": "Включить защиту локальной системы безопасности, чтобы предотвратить внедрение кода." "ToolTip": "Включить защиту локальной системы безопасности, чтобы предотвратить внедрение кода, без блокировки UEFI."
}, },
"One": { "One": {
"Tag": "Disable", "Tag": "Disable",

74
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -217,7 +217,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# https://www.youtube.com/GHOSTSPECTRE # https://www.youtube.com/GHOSTSPECTRE
"Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd" "Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd"
# https://github.com/hellzerg/optimizer # 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 # https://win10tweaker.ru
"Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker" "Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -1310,6 +1310,10 @@ function ErrorReporting
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1372,6 +1376,10 @@ function FeedbackFrequency
$Automatically $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Never" "Never"
@ -1381,10 +1389,12 @@ function FeedbackFrequency
New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -PropertyType DWord -Value 0 -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" "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
} }
} }
} }
@ -1736,6 +1746,10 @@ function SigninInfo
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1844,6 +1858,10 @@ function AdvertisingID
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1954,6 +1972,10 @@ function WindowsTips
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Enable" "Enable"
@ -2060,6 +2082,10 @@ function AppsSilentInstalling
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -2170,6 +2196,10 @@ function TailoredExperiences
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -4616,7 +4646,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip"
OutFile = "$DownloadsFolder\dark.zip" OutFile = "$DownloadsFolder\dark.zip"
@ -4630,7 +4660,7 @@ function Cursors
New-Item -Path "$env:SystemRoot\Cursors\W11_dark_v2.2" -ItemType Directory -Force New-Item -Path "$env:SystemRoot\Cursors\W11_dark_v2.2" -ItemType Directory -Force
} }
# Extract archive. We cannot call tar.exe due to it fails to extract files if username has cyrillic first letter in lowercase # Extract archive. We cannot call tar.exe due to it fails to extract files if username has cyrillic first letter in lowercase ###
# Start-Process -FilePath "$env:SystemRoot\System32\tar.exe" -ArgumentList "-xf `"$DownloadsFolder\dark.zip`" -C `"$env:SystemRoot\Cursors\W11_dark_v2.2`" -v" # Start-Process -FilePath "$env:SystemRoot\System32\tar.exe" -ArgumentList "-xf `"$DownloadsFolder\dark.zip`" -C `"$env:SystemRoot\Cursors\W11_dark_v2.2`" -v"
# https://github.com/PowerShell/PowerShell/issues/21070 # https://github.com/PowerShell/PowerShell/issues/21070
Add-Type -Assembly System.IO.Compression.FileSystem Add-Type -Assembly System.IO.Compression.FileSystem
@ -4652,10 +4682,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 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 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 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\person.cur" -Force
New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Person -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\pin.cur" -Force New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Pin -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 precisionhair -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\precision.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 "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 New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name SizeAll -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\move.cur" -Force
@ -4744,7 +4772,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip"
OutFile = "$DownloadsFolder\light.zip" OutFile = "$DownloadsFolder\light.zip"
@ -9600,9 +9628,9 @@ public static int UnloadHive(RegistryHives hive, string subKey)
Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore
[array]$UserRegisteredProgIDs = @() [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 ($Subkey)
{ {
if (Test-Path -Path "HKCU:\$Subkey\$Associations") if (Test-Path -Path "HKCU:\$Subkey\$Associations")
@ -9873,7 +9901,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)" -Type DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -9968,7 +9996,7 @@ function Export-Associations
# ProgrammPath # ProgrammPath
if ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Classes\$($_.ProgId)\shell\open\command", "", $null)) 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('"') $Program = $PartProgramPath.Substring(0, ($PartProgramPath.IndexOf(".exe") + 4)).Trim('"')
if ($Program) if ($Program)
@ -12185,7 +12213,7 @@ function HEVC
Write-Verbose -Message $Localization.HEVCDownloading -Verbose Write-Verbose -Message $Localization.HEVCDownloading -Verbose
$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 = @{ $Parameters = @{
Uri = $TempURL Uri = $TempURL
OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx"
@ -14005,7 +14033,7 @@ function EventViewerCustomView
} }
# Save ProcessCreation.xml in the UTF-8 without BOM encoding # Save ProcessCreation.xml in the UTF-8 without BOM encoding
Set-Content -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Value $XML -Encoding Default -NoNewline -Force Set-Content -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Value $XML -Encoding UTF8 -NoNewline -Force
} }
"Disable" "Disable"
{ {
@ -14560,15 +14588,15 @@ function CastToDeviceContext
{ {
"Hide" "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 "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore
} }
} }
} }
@ -14617,15 +14645,15 @@ function ShareContext
{ {
"Hide" "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 "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore
} }
} }
} }

58
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -217,7 +217,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# https://www.youtube.com/GHOSTSPECTRE # https://www.youtube.com/GHOSTSPECTRE
"Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd" "Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd"
# https://github.com/hellzerg/optimizer # 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 # https://win10tweaker.ru
"Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker" "Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -1266,6 +1266,10 @@ function ErrorReporting
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1328,6 +1332,10 @@ function FeedbackFrequency
$Automatically $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Never" "Never"
@ -1337,10 +1345,12 @@ function FeedbackFrequency
New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -PropertyType DWord -Value 0 -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" "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
} }
} }
} }
@ -1692,6 +1702,10 @@ function SigninInfo
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1800,6 +1814,10 @@ function AdvertisingID
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -3586,7 +3604,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip"
OutFile = "$DownloadsFolder\dark.zip" OutFile = "$DownloadsFolder\dark.zip"
@ -3622,10 +3640,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 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 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 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\person.cur" -Force
New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Person -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\pin.cur" -Force New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Pin -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 precisionhair -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\precision.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 "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 New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name SizeAll -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\move.cur" -Force
@ -3714,7 +3730,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip"
OutFile = "$DownloadsFolder\light.zip" OutFile = "$DownloadsFolder\light.zip"
@ -7906,9 +7922,9 @@ public static int UnloadHive(RegistryHives hive, string subKey)
Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore
[array]$UserRegisteredProgIDs = @() [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 ($Subkey)
{ {
if (Test-Path -Path "HKCU:\$Subkey\$Associations") if (Test-Path -Path "HKCU:\$Subkey\$Associations")
@ -8179,7 +8195,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)" -Type DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -8274,7 +8290,7 @@ function Export-Associations
# ProgrammPath # ProgrammPath
if ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Classes\$($_.ProgId)\shell\open\command", "", $null)) 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('"') $Program = $PartProgramPath.Substring(0, ($PartProgramPath.IndexOf(".exe") + 4)).Trim('"')
if ($Program) if ($Program)
@ -10559,7 +10575,7 @@ function EventViewerCustomView
} }
# Save ProcessCreation.xml in the UTF-8 without BOM encoding # Save ProcessCreation.xml in the UTF-8 without BOM encoding
Set-Content -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Value $XML -Encoding Default -NoNewline -Force Set-Content -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Value $XML -Encoding UTF8 -NoNewline -Force
} }
"Disable" "Disable"
{ {
@ -11109,15 +11125,15 @@ function CastToDeviceContext
{ {
"Hide" "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 "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore
} }
} }
} }
@ -11166,15 +11182,15 @@ function ShareContext
{ {
"Hide" "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 "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore
} }
} }
} }

64
src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1

@ -217,7 +217,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# https://www.youtube.com/GHOSTSPECTRE # https://www.youtube.com/GHOSTSPECTRE
"Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd" "Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd"
# https://github.com/hellzerg/optimizer # 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 # https://win10tweaker.ru
"Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker" "Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -1266,6 +1266,10 @@ function ErrorReporting
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1328,6 +1332,10 @@ function FeedbackFrequency
$Automatically $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Never" "Never"
@ -1337,10 +1345,12 @@ function FeedbackFrequency
New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -PropertyType DWord -Value 0 -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" "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
} }
} }
} }
@ -1692,6 +1702,10 @@ function SigninInfo
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1800,6 +1814,10 @@ function AdvertisingID
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1918,6 +1936,10 @@ function TailoredExperiences
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -3958,7 +3980,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip"
OutFile = "$DownloadsFolder\dark.zip" OutFile = "$DownloadsFolder\dark.zip"
@ -3994,10 +4016,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 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 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 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\person.cur" -Force
New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Person -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\pin.cur" -Force New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Pin -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 precisionhair -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\precision.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 "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 New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name SizeAll -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\move.cur" -Force
@ -4086,7 +4106,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip"
OutFile = "$DownloadsFolder\light.zip" OutFile = "$DownloadsFolder\light.zip"
@ -8533,9 +8553,9 @@ public static int UnloadHive(RegistryHives hive, string subKey)
Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore
[array]$UserRegisteredProgIDs = @() [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 ($Subkey)
{ {
if (Test-Path -Path "HKCU:\$Subkey\$Associations") if (Test-Path -Path "HKCU:\$Subkey\$Associations")
@ -8806,7 +8826,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)" -Type DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -8901,7 +8921,7 @@ function Export-Associations
# ProgrammPath # ProgrammPath
if ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Classes\$($_.ProgId)\shell\open\command", "", $null)) 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('"') $Program = $PartProgramPath.Substring(0, ($PartProgramPath.IndexOf(".exe") + 4)).Trim('"')
if ($Program) if ($Program)
@ -11690,7 +11710,7 @@ function EventViewerCustomView
} }
# Save ProcessCreation.xml in the UTF-8 without BOM encoding # Save ProcessCreation.xml in the UTF-8 without BOM encoding
Set-Content -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Value $XML -Encoding Default -NoNewline -Force Set-Content -Path "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" -Value $XML -Encoding UTF8 -NoNewline -Force
} }
"Disable" "Disable"
{ {
@ -12240,15 +12260,15 @@ function CastToDeviceContext
{ {
"Hide" "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 "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore
} }
} }
} }
@ -12297,15 +12317,15 @@ function ShareContext
{ {
"Hide" "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 "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore
} }
} }
} }
@ -12395,7 +12415,7 @@ function EditWithPaint3DContext
.NOTES .NOTES
Current user Current user
#> #>
function ImagesEditContext function ImagesEditContext ###
{ {
param param
( (

72
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -213,7 +213,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# https://www.youtube.com/GHOSTSPECTRE # https://www.youtube.com/GHOSTSPECTRE
"Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd" "Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd"
# https://github.com/hellzerg/optimizer # 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 # https://win10tweaker.ru
"Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker" "Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -1316,6 +1316,10 @@ function ErrorReporting
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1378,6 +1382,10 @@ function FeedbackFrequency
$Automatically $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Never" "Never"
@ -1387,10 +1395,12 @@ function FeedbackFrequency
New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -PropertyType DWord -Value 0 -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" "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
} }
} }
} }
@ -1742,6 +1752,10 @@ function SigninInfo
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1850,6 +1864,10 @@ function AdvertisingID
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1960,6 +1978,10 @@ function WindowsTips
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Enable" "Enable"
@ -2066,6 +2088,10 @@ function AppsSilentInstalling
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -2176,6 +2202,10 @@ function TailoredExperiences
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -4622,7 +4652,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip"
OutFile = "$DownloadsFolder\dark.zip" OutFile = "$DownloadsFolder\dark.zip"
@ -4658,10 +4688,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 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 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 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\person.cur" -Force
New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Person -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\pin.cur" -Force New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Pin -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 precisionhair -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\precision.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 "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 New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name SizeAll -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\move.cur" -Force
@ -4750,7 +4778,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip"
OutFile = "$DownloadsFolder\light.zip" OutFile = "$DownloadsFolder\light.zip"
@ -9606,9 +9634,9 @@ public static int UnloadHive(RegistryHives hive, string subKey)
Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore
[array]$UserRegisteredProgIDs = @() [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 ($Subkey)
{ {
if (Test-Path -Path "HKCU:\$Subkey\$Associations") if (Test-Path -Path "HKCU:\$Subkey\$Associations")
@ -9879,7 +9907,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)" -Type DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -9974,7 +10002,7 @@ function Export-Associations
# ProgrammPath # ProgrammPath
if ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Classes\$($_.ProgId)\shell\open\command", "", $null)) 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('"') $Program = $PartProgramPath.Substring(0, ($PartProgramPath.IndexOf(".exe") + 4)).Trim('"')
if ($Program) if ($Program)
@ -12211,7 +12239,7 @@ function HEVC
Write-Verbose -Message $Localization.HEVCDownloading -Verbose Write-Verbose -Message $Localization.HEVCDownloading -Verbose
$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 = @{ $Parameters = @{
Uri = $TempURL Uri = $TempURL
OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" OutFile = "$DownloadsFolder\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx"
@ -14368,7 +14396,7 @@ function WindowsSandbox
$Enable $Enable
) )
if (-not (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -eq "Enterprise")})) if (-not (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -eq "Enterprise") -or ($_.Edition -eq "Education")}))
{ {
return return
} }
@ -14586,15 +14614,15 @@ function CastToDeviceContext
{ {
"Hide" "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 "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -PropertyType String -Value "" -Force
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Force -ErrorAction Ignore
} }
} }
} }
@ -14643,15 +14671,15 @@ function ShareContext
{ {
"Hide" "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 "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -PropertyType String -Value "" -Force
} }
"Show" "Show"
{ {
Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{E2BF9676-5F8F-435C-97EB-11607A5BEDF7}" -Force -ErrorAction Ignore
} }
} }
} }

78
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -205,7 +205,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# https://www.youtube.com/GHOSTSPECTRE # https://www.youtube.com/GHOSTSPECTRE
"Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd" "Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd"
# https://github.com/hellzerg/optimizer # 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 # https://win10tweaker.ru
"Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker" "Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -1286,6 +1286,10 @@ function ErrorReporting
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1348,6 +1352,10 @@ function FeedbackFrequency
$Automatically $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Never" "Never"
@ -1357,10 +1365,12 @@ function FeedbackFrequency
New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -PropertyType DWord -Value 0 -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" "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 $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1826,6 +1840,10 @@ function AdvertisingID
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1936,6 +1954,10 @@ function WindowsTips
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Enable" "Enable"
@ -2042,6 +2064,10 @@ function AppsSilentInstalling
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -2152,6 +2178,10 @@ function TailoredExperiences
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -4206,7 +4236,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip"
OutFile = "$DownloadsFolder\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 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 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 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\person.cur" -Force
New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Person -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\pin.cur" -Force New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Pin -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 precisionhair -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\precision.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 "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 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 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip"
OutFile = "$DownloadsFolder\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 Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore
[array]$UserRegisteredProgIDs = @() [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 ($Subkey)
{ {
if (Test-Path -Path "HKCU:\$Subkey\$Associations") 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\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(".")) if ($Extension.Contains("."))
{ {
@ -9555,7 +9583,7 @@ function Export-Associations
# ProgrammPath # ProgrammPath
if ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Classes\$($_.ProgId)\shell\open\command", "", $null)) 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('"') $Program = $PartProgramPath.Substring(0, ($PartProgramPath.IndexOf(".exe") + 4)).Trim('"')
if ($Program) if ($Program)
@ -13261,7 +13289,7 @@ function EventViewerCustomView
} }
# Save ProcessCreation.xml in the UTF-8 with BOM encoding # 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" "Disable"
{ {
@ -13834,7 +13862,7 @@ function DNSoverHTTPS
Local Security Authority protection Local Security Authority protection
.PARAMETER Enable .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 .PARAMETER Disable
Disable Local Security Authority protection Disable Local Security Authority protection
@ -13900,9 +13928,9 @@ function LocalSecurityAuthority
"Disable" "Disable"
{ {
Remove-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa -Name RunAsPPL, RunAsPPLBoot -Force -ErrorAction Ignore 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 User -Path Software\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Type CLEAR Set-Policy -Scope Computer -Path Software\Policies\Microsoft\Windows\Explorer -Name RunAsPPL -Type CLEAR
} }
} }
} }
@ -14074,15 +14102,15 @@ function EditWithClipchampContext
{ {
"Hide" "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" "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" "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" "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" "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 Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{9F156763-7844-4DC4-B2B1-901F640F5155}" -ErrorAction Ignore
if ($Terminal.profiles.defaults.elevate) if ($Terminal.profiles.defaults.elevate)

77
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -201,7 +201,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd);
# https://www.youtube.com/GHOSTSPECTRE # https://www.youtube.com/GHOSTSPECTRE
"Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd" "Ghost Toolbox" = "$env:SystemRoot\System32\migwiz\dlmanifests\run.ghost.cmd"
# https://github.com/hellzerg/optimizer # 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 # https://win10tweaker.ru
"Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker" "Win 10 Tweaker" = "HKCU:\Software\Win 10 Tweaker"
# https://forum.ru-board.com/topic.cgi?forum=5&topic=50519 # https://forum.ru-board.com/topic.cgi?forum=5&topic=50519
@ -1289,6 +1289,10 @@ function ErrorReporting
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1351,6 +1355,10 @@ function FeedbackFrequency
$Automatically $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Never" "Never"
@ -1360,10 +1368,12 @@ function FeedbackFrequency
New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force New-Item -Path HKCU:\Software\Microsoft\Siuf\Rules -Force
} }
New-ItemProperty -Path HKCU:\Software\Microsoft\Siuf\Rules -Name NumberOfSIUFInPeriod -PropertyType DWord -Value 0 -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" "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
} }
} }
} }
@ -1721,6 +1731,10 @@ function SigninInfo
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1829,6 +1843,10 @@ function AdvertisingID
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -1939,6 +1957,10 @@ function WindowsTips
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Enable" "Enable"
@ -2045,6 +2067,10 @@ function AppsSilentInstalling
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -2155,6 +2181,10 @@ function TailoredExperiences
$Enable $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) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Disable"
@ -4209,7 +4239,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/dark.zip"
OutFile = "$DownloadsFolder\dark.zip" OutFile = "$DownloadsFolder\dark.zip"
@ -4245,10 +4275,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 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 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 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\person.cur" -Force
New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Person -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\pin.cur" -Force New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name Pin -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 precisionhair -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\precision.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 "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 New-ItemProperty -Path "HKCU:\Control Panel\Cursors" -Name SizeAll -PropertyType ExpandString -Value "%SystemRoot%\Cursors\W11_dark_v2.2\move.cur" -Force
@ -4337,7 +4365,7 @@ function Cursors
return 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 = @{ $Parameters = @{
Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip" Uri = "https://github.com/farag2/Sophia-Script-for-Windows/raw/master/Misc/light.zip"
OutFile = "$DownloadsFolder\light.zip" OutFile = "$DownloadsFolder\light.zip"
@ -9190,9 +9218,9 @@ public static int UnloadHive(RegistryHives hive, string subKey)
Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore Clear-Variable -Name UserRegisteredProgIDs -Force -ErrorAction Ignore
[array]$UserRegisteredProgIDs = @() [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 ($Subkey)
{ {
if (Test-Path -Path "HKCU:\$Subkey\$Associations") if (Test-Path -Path "HKCU:\$Subkey\$Associations")
@ -9463,7 +9491,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)" -Type DWord -Value 0 -Force
if ($Extension.Contains(".")) if ($Extension.Contains("."))
{ {
@ -9558,7 +9586,7 @@ function Export-Associations
# ProgrammPath # ProgrammPath
if ([Microsoft.Win32.Registry]::GetValue("HKEY_CURRENT_USER\Software\Classes\$($_.ProgId)\shell\open\command", "", $null)) 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('"') $Program = $PartProgramPath.Substring(0, ($PartProgramPath.IndexOf(".exe") + 4)).Trim('"')
if ($Program) if ($Program)
@ -13198,7 +13226,9 @@ function CommandLineProcessAudit
} }
"Disable" "Disable"
{ {
auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:disable /failure:disable
Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Force -ErrorAction Ignore Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Type CLEAR Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Type CLEAR
} }
} }
@ -13855,7 +13885,7 @@ function DNSoverHTTPS
Local Security Authority protection Local Security Authority protection
.PARAMETER Enable .PARAMETER Enable
Enable Local Security Authority protection to prevent code injection Enable Local Security Authority protection to prevent code injection without UEFI lock
.PARAMETER Disable .PARAMETER Disable
Disable Local Security Authority protection Disable Local Security Authority protection
@ -13921,6 +13951,9 @@ function LocalSecurityAuthority
"Disable" "Disable"
{ {
Remove-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Lsa -Name RunAsPPL, RunAsPPLBoot -Force -ErrorAction Ignore 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
Set-Policy -Scope Computer -Path Software\Policies\Microsoft\Windows\Explorer -Name RunAsPPL -Type CLEAR
} }
} }
} }
@ -14092,15 +14125,15 @@ function EditWithClipchampContext
{ {
"Hide" "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" "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
} }
} }
} }
@ -14372,15 +14405,15 @@ function OpenWindowsTerminalContext
{ {
"Show" "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" "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
} }
} }
} }
@ -14455,7 +14488,7 @@ function OpenWindowsTerminalAdminContext
{ {
"Enable" "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 Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{9F156763-7844-4DC4-B2B1-901F640F5155}" -ErrorAction Ignore
if ($Terminal.profiles.defaults.elevate) if ($Terminal.profiles.defaults.elevate)

Loading…
Cancel
Save