Browse Source

Minor fixes. Install-WSA removed

master
Dmitry Nefedov 4 months ago
parent
commit
9b0d854fd2
  1. 13
      Wrapper/Config/config_Windows_11.json
  2. 10
      Wrapper/Localizations/de-DE/tooltip_Windows_11.json
  3. 10
      Wrapper/Localizations/en-US/tooltip_Windows_11.json
  4. 10
      Wrapper/Localizations/ru-RU/tooltip_Windows_11.json
  5. 19
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  6. 4
      src/Sophia_Script_for_Windows_10/Sophia.ps1
  7. 9
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  8. 15
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  9. 4
      src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1
  10. 17
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  11. 4
      src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1
  12. 111
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  13. 8
      src/Sophia_Script_for_Windows_11/Sophia.ps1
  14. 108
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1
  15. 8
      src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

13
Wrapper/Config/config_Windows_11.json

@ -1599,19 +1599,6 @@
"Preset": "Zero",
"WindowsDefault": "One"
},
{
"Region": "System",
"Control": "cmb",
"Required": "false",
"Function": "Install-WSA",
"Arg": {
"Zero": {
"Tag": ""
}
},
"Preset": "",
"WindowsDefault": ""
},
{
"Region": "System",
"Control": "cmb",

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

@ -1413,16 +1413,6 @@
}
}
},
{
"Region": "System",
"Function": "Install-WSA",
"Arg": {
"Zero": {
"Tag": "",
"ToolTip": "Alle erforderlichen Abhängigkeiten aktivieren (ein Neustart kann erforderlich sein) und die Microsoft Store WSA-Seite öffnen, um Windows Subsystem for Android™ mit Amazon-Appstore manuell zu installieren."
}
}
},
{
"Region": "System",
"Function": "PreventEdgeShortcutCreation",

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

@ -1413,16 +1413,6 @@
}
}
},
{
"Region": "System",
"Function": "Install-WSA",
"Arg": {
"Zero": {
"Tag": "",
"ToolTip": "Enable all necessary dependencies (reboot may require) and open Microsoft Store WSA page to install Windows Subsystem for Android™ with Amazon Appstore manually."
}
}
},
{
"Region": "System",
"Function": "PreventEdgeShortcutCreation",

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

@ -1413,16 +1413,6 @@
}
}
},
{
"Region": "System",
"Function": "Install-WSA",
"Arg": {
"Zero": {
"Tag": "",
"ToolTip": "Включить все необходимые зависимости (может потребоваться перезагрузка) и открыть страницу WSA в Microsoft Store, чтобы вручную установить Windows Subsystem for Android™ with Amazon Appstore."
}
}
},
{
"Region": "System",
"Function": "PreventEdgeShortcutCreation",

19
src/Sophia_Script_for_Windows_10/Module/Sophia.psm1

@ -1020,6 +1020,9 @@ function CreateRestorePoint
.EXAMPLE
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 0
.EXAMPLE
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Type DWORD -Value 1
.NOTES
https://techcommunity.microsoft.com/t5/microsoft-security-baselines/lgpo-exe-local-group-policy-object-utility-v1-0/ba-p/701045
@ -1312,7 +1315,9 @@ function ErrorReporting
# 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
Remove-ItemProperty -Path "HKCU:\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
Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
@ -2215,13 +2220,13 @@ function TailoredExperiences
<#
.SYNOPSIS
Bing search in the Start Menu
Bing search in Start Menu
.PARAMETER Disable
Disable Bing search in the Start Menu
Disable Bing search in Start Menu
.PARAMETER Enable
Enable Bing search in the Start Menu
Enable Bing search in Start Menu
.EXAMPLE
BingSearch -Disable
@ -13935,7 +13940,9 @@ function CommandLineProcessAudit
}
"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
Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Type CLEAR
}
}
@ -14019,7 +14026,7 @@ function EventViewerCustomView
}
# Save ProcessCreation.xml in the UTF-8 without 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 Default -NoNewline -Force
}
"Disable"
{
@ -15192,6 +15199,10 @@ function UseStoreOpenWith
$Show
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
"Hide"

4
src/Sophia_Script_for_Windows_10/Sophia.ps1

@ -249,11 +249,11 @@ TailoredExperiences -Disable
# Разрешите корпорации Майкософт использовать ваши диагностические данные для предоставления вам персонализированных советов, рекламы и рекомендаций, чтобы улучшить работу со службами Майкрософт (значение по умолчанию)
# TailoredExperiences -Enable
# Disable Bing search in the Start Menu
# Disable Bing search in Start Menu
# Отключить в меню "Пуск" поиск через Bing
BingSearch -Disable
# Enable Bing search in the Start Menu (default value)
# Enable Bing search in Start Menu (default value)
# Включить поиск через Bing в меню "Пуск" (значение по умолчанию)
# BingSearch -Enable

9
src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1

@ -989,6 +989,9 @@ function CreateRestorePoint
.EXAMPLE
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 0
.EXAMPLE
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Type DWORD -Value 1
.NOTES
https://techcommunity.microsoft.com/t5/microsoft-security-baselines/lgpo-exe-local-group-policy-object-utility-v1-0/ba-p/701045
@ -1268,7 +1271,9 @@ function ErrorReporting
# 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
Remove-ItemProperty -Path "HKCU:\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
Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
@ -10477,7 +10482,9 @@ function CommandLineProcessAudit
}
"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
Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Type CLEAR
}
}
@ -10561,7 +10568,7 @@ function EventViewerCustomView
}
# Save ProcessCreation.xml in the UTF-8 without 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 Default -NoNewline -Force
}
"Disable"
{

15
src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1

@ -989,6 +989,9 @@ function CreateRestorePoint
.EXAMPLE
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 0
.EXAMPLE
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Type DWORD -Value 1
.NOTES
https://techcommunity.microsoft.com/t5/microsoft-security-baselines/lgpo-exe-local-group-policy-object-utility-v1-0/ba-p/701045
@ -1268,7 +1271,9 @@ function ErrorReporting
# 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
Remove-ItemProperty -Path "HKCU:\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
Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
@ -1955,13 +1960,13 @@ function TailoredExperiences
<#
.SYNOPSIS
Bing search in the Start Menu
Bing search in Start Menu
.PARAMETER Disable
Disable Bing search in the Start Menu
Disable Bing search in Start Menu
.PARAMETER Enable
Enable Bing search in the Start Menu
Enable Bing search in Start Menu
.EXAMPLE
BingSearch -Disable
@ -11612,7 +11617,9 @@ function CommandLineProcessAudit
}
"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
Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Type CLEAR
}
}
@ -11696,7 +11703,7 @@ function EventViewerCustomView
}
# Save ProcessCreation.xml in the UTF-8 without 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 Default -NoNewline -Force
}
"Disable"
{

4
src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1

@ -212,11 +212,11 @@ TailoredExperiences -Disable
# Разрешите корпорации Майкософт использовать ваши диагностические данные для предоставления вам персонализированных советов, рекламы и рекомендаций, чтобы улучшить работу со службами Майкрософт (значение по умолчанию)
# TailoredExperiences -Enable
# Disable Bing search in the Start Menu
# Disable Bing search in Start Menu
# Отключить в меню "Пуск" поиск через Bing
BingSearch -Disable
# Enable Bing search in the Start Menu (default value)
# Enable Bing search in Start Menu (default value)
# Включить поиск через Bing в меню "Пуск" (значение по умолчанию)
# BingSearch -Enable
#endregion Privacy & Telemetry

17
src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1

@ -1026,6 +1026,9 @@ function CreateRestorePoint
.EXAMPLE
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 0
.EXAMPLE
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Type DWORD -Value 1
.NOTES
https://techcommunity.microsoft.com/t5/microsoft-security-baselines/lgpo-exe-local-group-policy-object-utility-v1-0/ba-p/701045
@ -1318,7 +1321,9 @@ function ErrorReporting
# 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
Remove-ItemProperty -Path "HKCU:\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
Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
@ -2221,13 +2226,13 @@ function TailoredExperiences
<#
.SYNOPSIS
Bing search in the Start Menu
Bing search in Start Menu
.PARAMETER Disable
Disable Bing search in the Start Menu
Disable Bing search in Start Menu
.PARAMETER Enable
Enable Bing search in the Start Menu
Enable Bing search in Start Menu
.EXAMPLE
BingSearch -Disable
@ -13961,7 +13966,9 @@ function CommandLineProcessAudit
}
"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
Set-Policy -Scope Computer -Path SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -Type CLEAR
}
}
@ -15218,6 +15225,10 @@ function UseStoreOpenWith
$Show
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
"Hide"

4
src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1

@ -260,11 +260,11 @@ TailoredExperiences -Disable
# Разрешите корпорации Майкософт использовать ваши диагностические данные для предоставления вам персонализированных советов, рекламы и рекомендаций, чтобы улучшить работу со службами Майкрософт (значение по умолчанию)
# TailoredExperiences -Enable
# Disable Bing search in the Start Menu
# Disable Bing search in Start Menu
# Отключить в меню "Пуск" поиск через Bing
BingSearch -Disable
# Enable Bing search in the Start Menu (default value)
# Enable Bing search in Start Menu (default value)
# Включить поиск через Bing в меню "Пуск" (значение по умолчанию)
# BingSearch -Enable

111
src/Sophia_Script_for_Windows_11/Module/Sophia.psm1

@ -996,6 +996,9 @@ function CreateRestorePoint
.EXAMPLE
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 0
.EXAMPLE
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Type DWORD -Value 1
.NOTES
https://techcommunity.microsoft.com/t5/microsoft-security-baselines/lgpo-exe-local-group-policy-object-utility-v1-0/ba-p/701045
@ -1288,7 +1291,9 @@ function ErrorReporting
# 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
Remove-ItemProperty -Path "HKCU:\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
Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
@ -2197,13 +2202,13 @@ function TailoredExperiences
<#
.SYNOPSIS
Bing search in the Start Menu
Bing search in Start Menu
.PARAMETER Disable
Disable Bing search in the Start Menu
Disable Bing search in Start Menu
.PARAMETER Enable
Enable Bing search in the Start Menu
Enable Bing search in Start Menu
.EXAMPLE
BingSearch -Disable
@ -10142,87 +10147,6 @@ function RKNBypass
}
}
<#
.SYNOPSIS
Enable all necessary dependencies (reboot may require) and open Microsoft Store WSA page to install it manually
.LINK
https://support.microsoft.com/en-us/windows/install-mobile-apps-and-the-amazon-appstore-f8d0abb5-44ad-47d8-b9fb-ad6b1459ff6c
.LINK
https://docs.microsoft.com/en-us/windows/android/wsa/
.LINK
https://apps.microsoft.com/store/detail/windows-subsystem-for-android-with-amazon-appstore/9P3395VX91NR
.NOTES
Machine-wide
#>
function Install-WSA
{
# Enable Virtual Machine Platform
if ((Get-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform).State -eq "Disabled")
{
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
Write-Warning -Message $Localization.RestartWarning
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
return
}
if (Get-AppxPackage -Name MicrosoftCorporationII.WindowsSubsystemForAndroid)
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Skipped -Verbose
return
}
# Check whether Windows 11 is installed on an SSD
$DiskNumber = (Get-Disk | Where-Object -FilterScript {$_.Isboot -and $_.IsSystem -and ($_.OperationalStatus -eq "Online")}).Number
if (Get-PhysicalDisk -DeviceNumber $DiskNumber | Where-Object -FilterScript {$_.MediaType -ne "SSD"})
{
Write-Warning -Message $Localization.SSDRequired
return
}
try
{
# Check the internet connection
$Parameters = @{
Name = "dns.msftncsi.com"
Server = "1.1.1.1"
DnsOnly = $true
ErrorAction = "Stop"
}
if ((Resolve-DnsName @Parameters).IPAddress -notcontains "131.107.255.255")
{
return
}
if (((Get-WinHomeLocation).GeoId -ne "244"))
{
# Set Windows region to USA
$Script:Region = (Get-WinHomeLocation).GeoId
Set-WinHomeLocation -GeoId 244
$Script:RegionChanged = $true
}
# Open Misrosoft Store WSA page to install it manually
Start-Process -FilePath ms-windows-store://pdp/?ProductId=9P3395VX91NR
}
catch [System.ComponentModel.Win32Exception]
{
Write-Warning -Message $Localization.NoInternetConnection
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
}
}
<#
.SYNOPSIS
Desktop shortcut creation upon Microsoft Edge update
@ -13274,8 +13198,8 @@ function EventViewerCustomView
New-Item -Path "$env:ProgramData\Microsoft\Event Viewer\Views" -ItemType Directory -Force
}
# 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
# 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
}
"Disable"
{
@ -13884,6 +13808,9 @@ function LocalSecurityAuthority
$Disable
)
# Remove all policies in order to make changes visible in UI only if it's possible
Set-Policy -Scope Computer -Path Software\Policies\Microsoft\Windows\Explorer -Name RunAsPPL -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
"Enable"
@ -13915,8 +13842,6 @@ function LocalSecurityAuthority
{
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
}
}
}
@ -14299,6 +14224,10 @@ function UseStoreOpenWith
$Show
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
"Hide"
@ -14711,12 +14640,6 @@ public static void PostMessage()
}
}
if ($Script:RegionChanged)
{
# Set the original region ID
Set-WinHomeLocation -GeoId $Script:Region
}
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt"))
{

8
src/Sophia_Script_for_Windows_11/Sophia.ps1

@ -248,11 +248,11 @@ TailoredExperiences -Disable
# Разрешить корпорации Майкрософт использовать диагностические данные для персонализированных советов, рекламы и рекомендаций (значение по умолчанию)
# TailoredExperiences -Enable
# Disable Bing search in the Start Menu
# Disable Bing search in Start Menu
# Отключить в меню "Пуск" поиск через Bing
BingSearch -Disable
# Enable Bing search in the Start Menu (default value)
# Enable Bing search in Start Menu (default value)
# Включить поиск через Bing в меню "Пуск" (значение по умолчанию)
# BingSearch -Enable
@ -1004,10 +1004,6 @@ RKNBypass -Enable
# https://antizapret.prostovpn.org
# RKNBypass -Disable
# Enable all necessary dependencies (reboot may require) and open Microsoft Store WSA page to install Windows Subsystem for Android™ with Amazon Appstore manually
# Включить все необходимые зависимости (может потребоваться перезагрузка) и открыть страницу WSA в Microsoft Store, чтобы вручную установить Windows Subsystem for Android™ with Amazon Appstore
# Install-WSA
# List Microsoft Edge channels to prevent desktop shortcut creation upon its update
# Перечислите каналы Microsoft Edge для предотвращения создания ярлыков на рабочем столе после его обновления
PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary

108
src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1

@ -999,6 +999,9 @@ function CreateRestorePoint
.EXAMPLE
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Type DWORD -Value 0
.EXAMPLE
Set-Policy -Scope User -Path Software\Policies\Microsoft\Windows\Explorer -Name DisableSearchBoxSuggestions -Type DWORD -Value 1
.NOTES
https://techcommunity.microsoft.com/t5/microsoft-security-baselines/lgpo-exe-local-group-policy-object-utility-v1-0/ba-p/701045
@ -1293,6 +1296,9 @@ function ErrorReporting
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
Remove-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Force -ErrorAction Ignore
Set-Policy -Scope User -Path "Software\Policies\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
"Disable"
@ -2200,13 +2206,13 @@ function TailoredExperiences
<#
.SYNOPSIS
Bing search in the Start Menu
Bing search in Start Menu
.PARAMETER Disable
Disable Bing search in the Start Menu
Disable Bing search in Start Menu
.PARAMETER Enable
Enable Bing search in the Start Menu
Enable Bing search in Start Menu
.EXAMPLE
BingSearch -Disable
@ -10145,87 +10151,6 @@ function RKNBypass
}
}
<#
.SYNOPSIS
Enable all necessary dependencies (reboot may require) and open Microsoft Store WSA page to install it manually
.LINK
https://support.microsoft.com/en-us/windows/install-mobile-apps-and-the-amazon-appstore-f8d0abb5-44ad-47d8-b9fb-ad6b1459ff6c
.LINK
https://docs.microsoft.com/en-us/windows/android/wsa/
.LINK
https://apps.microsoft.com/store/detail/windows-subsystem-for-android-with-amazon-appstore/9P3395VX91NR
.NOTES
Machine-wide
#>
function Install-WSA
{
# Enable Virtual Machine Platform
if ((Get-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform).State -eq "Disabled")
{
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart
Write-Warning -Message $Localization.RestartWarning
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
return
}
if (Get-AppxPackage -Name MicrosoftCorporationII.WindowsSubsystemForAndroid)
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Skipped -Verbose
return
}
# Check whether Windows 11 is installed on an SSD
$DiskNumber = (Get-Disk | Where-Object -FilterScript {$_.Isboot -and $_.IsSystem -and ($_.OperationalStatus -eq "Online")}).Number
if (Get-PhysicalDisk -DeviceNumber $DiskNumber | Where-Object -FilterScript {$_.MediaType -ne "SSD"})
{
Write-Warning -Message $Localization.SSDRequired
return
}
try
{
# Check the internet connection
$Parameters = @{
Name = "dns.msftncsi.com"
Server = "1.1.1.1"
DnsOnly = $true
ErrorAction = "Stop"
}
if ((Resolve-DnsName @Parameters).IPAddress -notcontains "131.107.255.255")
{
return
}
if (((Get-WinHomeLocation).GeoId -ne "244"))
{
# Set Windows region to USA
$Script:Region = (Get-WinHomeLocation).GeoId
Set-WinHomeLocation -GeoId 244
$Script:RegionChanged = $true
}
# Open Misrosoft Store WSA page to install it manually
Start-Process -FilePath ms-windows-store://pdp/?ProductId=9P3395VX91NR
}
catch [System.ComponentModel.Win32Exception]
{
Write-Warning -Message $Localization.NoInternetConnection
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
Write-Error -Message ($Localization.RestartFunction -f $MyInvocation.Line.Trim()) -ErrorAction SilentlyContinue
}
}
<#
.SYNOPSIS
Desktop shortcut creation upon Microsoft Edge update
@ -13907,6 +13832,9 @@ function LocalSecurityAuthority
$Disable
)
# Remove all policies in order to make changes visible in UI only if it's possible
Set-Policy -Scope Computer -Path Software\Policies\Microsoft\Windows\Explorer -Name RunAsPPL -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
"Enable"
@ -13938,8 +13866,6 @@ function LocalSecurityAuthority
{
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
}
}
}
@ -14322,6 +14248,10 @@ function UseStoreOpenWith
$Show
)
# Remove all policies in order to make changes visible in UI only if it's possible
Remove-ItemProperty -Path HKLM:\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Force -ErrorAction Ignore
Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoUseStoreOpenWith -Type CLEAR
switch ($PSCmdlet.ParameterSetName)
{
"Hide"
@ -14734,12 +14664,6 @@ public static void PostMessage()
}
}
if ($Script:RegionChanged)
{
# Set the original region ID
Set-WinHomeLocation -GeoId $Script:Region
}
# Apply policies found in registry to re-build database database due to gpedit.msc relies in its own database
if ((Test-Path -Path "$env:TEMP\Computer.txt") -or (Test-Path -Path "$env:TEMP\User.txt"))
{

8
src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

@ -259,11 +259,11 @@ TailoredExperiences -Disable
# Разрешить корпорации Майкрософт использовать диагностические данные для персонализированных советов, рекламы и рекомендаций (значение по умолчанию)
# TailoredExperiences -Enable
# Disable Bing search in the Start Menu
# Disable Bing search in Start Menu
# Отключить в меню "Пуск" поиск через Bing
BingSearch -Disable
# Enable Bing search in the Start Menu (default value)
# Enable Bing search in Start Menu (default value)
# Включить поиск через Bing в меню "Пуск" (значение по умолчанию)
# BingSearch -Enable
@ -1015,10 +1015,6 @@ RKNBypass -Enable
# https://antizapret.prostovpn.org
# RKNBypass -Disable
# Enable all necessary dependencies (reboot may require) and open Microsoft Store WSA page to install Windows Subsystem for Android™ with Amazon Appstore manually
# Включить все необходимые зависимости (может потребоваться перезагрузка) и открыть страницу WSA в Microsoft Store, чтобы вручную установить Windows Subsystem for Android™ with Amazon Appstore
# Install-WSA
# List Microsoft Edge channels to prevent desktop shortcut creation upon its update
# Перечислите каналы Microsoft Edge для предотвращения создания ярлыков на рабочем столе после его обновления
PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary

Loading…
Cancel
Save