Browse Source

31.12.2022 6.0.11

pull/326/head
Dmitry Nefedov 3 years ago
parent
commit
3aea9e9738
  1. 8
      Sophia Script/Sophia Script for Windows 10 LTSC 2019/Functions.ps1
  2. 2
      Sophia Script/Sophia Script for Windows 10 LTSC 2019/Manifest/Sophia.psd1
  3. 6
      Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1
  4. 8
      Sophia Script/Sophia Script for Windows 10 LTSC 2019/Sophia.ps1
  5. 8
      Sophia Script/Sophia Script for Windows 10 LTSC 2021/Functions.ps1
  6. 2
      Sophia Script/Sophia Script for Windows 10 LTSC 2021/Manifest/Sophia.psd1
  7. 42
      Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1
  8. 8
      Sophia Script/Sophia Script for Windows 10 LTSC 2021/Sophia.ps1
  9. 10
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Functions.ps1
  10. 4
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Manifest/Sophia.psd1
  11. 68
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1
  12. 10
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Sophia.ps1
  13. 10
      Sophia Script/Sophia Script for Windows 10/Functions.ps1
  14. 4
      Sophia Script/Sophia Script for Windows 10/Manifest/Sophia.psd1
  15. 66
      Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1
  16. 10
      Sophia Script/Sophia Script for Windows 10/Sophia.ps1
  17. 10
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Functions.ps1
  18. 4
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Manifest/Sophia.psd1
  19. 101
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1
  20. 10
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Sophia.ps1
  21. 10
      Sophia Script/Sophia Script for Windows 11/Functions.ps1
  22. 4
      Sophia Script/Sophia Script for Windows 11/Manifest/Sophia.psd1
  23. 101
      Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1
  24. 10
      Sophia Script/Sophia Script for Windows 11/Sophia.ps1
  25. 4
      sophia_script_versions.json

8
Sophia Script/Sophia Script for Windows 10 LTSC 2019/Functions.ps1

@ -3,10 +3,10 @@
The TAB completion for functions and their arguments
Version: v5.2.19
Date: 15.12.2021
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC v5.2.19 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC v5.2.19 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

2
Sophia Script/Sophia Script for Windows 10 LTSC 2019/Manifest/Sophia.psd1

@ -3,7 +3,7 @@
ModuleVersion = '5.2.19'
GUID = 'a36a65ca-70f9-43df-856c-3048fc5e7f01'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2021 farag & Inestic. All rights reserved'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'
Description = 'Module for Windows fine-tuning and automating the routine tasks'
PowerShellVersion = '5.1'
ProcessorArchitecture = 'AMD64'

6
Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1

@ -3,10 +3,10 @@
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.2.19
Date: 15.12.2021
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved

8
Sophia Script/Sophia Script for Windows 10 LTSC 2019/Sophia.ps1

@ -3,10 +3,10 @@
Default preset file for "Sophia Script for Windows 10 LTSC 2019"
Version: v5.2.19
Date: 15.12.2021
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -71,7 +71,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC v5.2.19 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC v5.2.19 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

8
Sophia Script/Sophia Script for Windows 10 LTSC 2021/Functions.ps1

@ -3,10 +3,10 @@
The TAB completion for functions and their arguments
Version: v5.12.9
Date: 15.12.2021
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.9 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.9 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

2
Sophia Script/Sophia Script for Windows 10 LTSC 2021/Manifest/Sophia.psd1

@ -3,7 +3,7 @@
ModuleVersion = '5.12.9'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2021 farag & Inestic. All rights reserved'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'
Description = 'Module for Windows fine-tuning and automating the routine tasks'
PowerShellVersion = '5.1'
ProcessorArchitecture = 'AMD64'

42
Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1

@ -3,10 +3,10 @@
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.12.9
Date: 15.12.2021
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -3679,7 +3679,7 @@ function WaitNetworkStartup
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon"))
{
@ -3690,7 +3690,7 @@ function WaitNetworkStartup
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SyncForegroundPolicy -Force -ErrorAction Ignore
}
@ -4506,7 +4506,7 @@ function UpdateMicrosoftProducts
}
"Disable"
{
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService -eq $true)
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService)
{
(New-Object -ComObject Microsoft.Update.ServiceManager).RemoveService("7971f918-a847-4430-9279-4a52d1efe18d")
}
@ -6472,7 +6472,7 @@ function NetworkDiscovery
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled True
@ -6482,7 +6482,7 @@ function NetworkDiscovery
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled False
}
@ -7387,7 +7387,7 @@ function WSL
function RadioButtonChecked
{
$Global:CommandTag = $_.OriginalSource.Tag
if ($ButtonInstall.IsEnabled -eq $false)
if (-not $ButtonInstall.IsEnabled)
{
$ButtonInstall.IsEnabled = $true
}
@ -8546,14 +8546,14 @@ function NetworkProtection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Disabled
}
@ -8603,14 +8603,14 @@ function PUAppsDetection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Disabled
}
@ -8663,14 +8663,14 @@ function DefenderSandbox
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 1
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 0
}
@ -9201,10 +9201,10 @@ function WindowsSandbox
{
"Disable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -9213,7 +9213,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -9227,10 +9227,10 @@ function WindowsSandbox
}
"Enable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}
@ -9239,7 +9239,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}

8
Sophia Script/Sophia Script for Windows 10 LTSC 2021/Sophia.ps1

@ -3,10 +3,10 @@
Default preset file for "Sophia Script for Windows 10 LTSC 2021"
Version: v5.12.9
Date: 15.12.2021
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -71,7 +71,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.9 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.9 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

10
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Functions.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.12.9
Date: 15.12.2021
Version: v5.12.10
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.9 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.10 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

4
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Manifest/Sophia.psd1

@ -1,9 +1,9 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.12.9'
ModuleVersion = '5.12.10'
GUID = 'aa0b47a7-1770-4b5d-8c9f-cc6c505bcc7a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2021 farag & Inestic. All rights reserved'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'
Description = 'Module for Windows fine-tuning and automating the routine tasks'
PowerShellVersion = '7.1'
ProcessorArchitecture = 'AMD64'

68
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1

@ -2,11 +2,11 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.12.9
Date: 15.12.2021
Version: v5.12.10
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -414,7 +414,7 @@ function DiagnosticDataLevel
{
"Minimal"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -like "Enterprise*" -or $_.Edition -eq "Education"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")})
{
# Security level
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 0 -Force
@ -2659,11 +2659,15 @@ function NewsInterests
{
"Disable"
{
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 2 -Force
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds"))
{
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name EnableFeeds -PropertyType DWord -Value 0 -Force
}
"Enable"
{
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 0 -Force
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name EnableFeeds -Force -ErrorAction Ignore
}
}
}
@ -4509,7 +4513,7 @@ function WaitNetworkStartup
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon"))
{
@ -4520,7 +4524,7 @@ function WaitNetworkStartup
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SyncForegroundPolicy -Force -ErrorAction Ignore
}
@ -5337,7 +5341,7 @@ function UpdateMicrosoftProducts
}
"Disable"
{
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService -eq $true)
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService)
{
(New-Object -ComObject Microsoft.Update.ServiceManager).RemoveService("7971f918-a847-4430-9279-4a52d1efe18d")
}
@ -7343,7 +7347,7 @@ function NetworkDiscovery
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled True
@ -7353,7 +7357,7 @@ function NetworkDiscovery
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled False
}
@ -8290,7 +8294,7 @@ function WSL
function RadioButtonChecked
{
$Global:CommandTag = $_.OriginalSource.Tag
if ($ButtonInstall.IsEnabled -eq $false)
if (-not $ButtonInstall.IsEnabled)
{
$ButtonInstall.IsEnabled = $true
}
@ -9971,13 +9975,19 @@ function XboxGameBar
{
"Disable"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force
if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp))
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force
}
}
"Enable"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force
if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp))
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force
}
}
}
}
@ -10669,14 +10679,14 @@ function NetworkProtection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Disabled
}
@ -10726,14 +10736,14 @@ function PUAppsDetection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Disabled
}
@ -10786,14 +10796,14 @@ function DefenderSandbox
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 1
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 0
}
@ -11324,10 +11334,10 @@ function WindowsSandbox
{
"Disable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -11336,7 +11346,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -11350,10 +11360,10 @@ function WindowsSandbox
}
"Enable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}
@ -11362,7 +11372,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}

10
Sophia Script/Sophia Script for Windows 10 PowerShell 7/Sophia.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10 (PowerShell 7)"
Version: v5.12.9
Date: 15.12.2021
Version: v5.12.10
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -71,7 +71,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.9 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.10 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

10
Sophia Script/Sophia Script for Windows 10/Functions.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.12.9
Date: 15.12.2021
Version: v5.12.10
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.9 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.10 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

4
Sophia Script/Sophia Script for Windows 10/Manifest/Sophia.psd1

@ -1,9 +1,9 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.12.9'
ModuleVersion = '5.12.10'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2021 farag & Inestic. All rights reserved'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'
Description = 'Module for Windows fine-tuning and automating the routine tasks'
PowerShellVersion = '5.1'
ProcessorArchitecture = 'AMD64'

66
Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1

@ -2,11 +2,11 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.12.9
Date: 15.12.2021
Version: v5.12.10
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -2644,11 +2644,15 @@ function NewsInterests
{
"Disable"
{
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 2 -Force
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds"))
{
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Force
}
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name EnableFeeds -PropertyType DWord -Value 0 -Force
}
"Enable"
{
New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 0 -Force
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" -Name EnableFeeds -Force -ErrorAction Ignore
}
}
}
@ -4479,7 +4483,7 @@ function WaitNetworkStartup
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon"))
{
@ -4490,7 +4494,7 @@ function WaitNetworkStartup
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SyncForegroundPolicy -Force -ErrorAction Ignore
}
@ -5306,7 +5310,7 @@ function UpdateMicrosoftProducts
}
"Disable"
{
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService -eq $true)
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService)
{
(New-Object -ComObject Microsoft.Update.ServiceManager).RemoveService("7971f918-a847-4430-9279-4a52d1efe18d")
}
@ -7310,7 +7314,7 @@ function NetworkDiscovery
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled True
@ -7320,7 +7324,7 @@ function NetworkDiscovery
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled False
}
@ -8257,7 +8261,7 @@ function WSL
function RadioButtonChecked
{
$Global:CommandTag = $_.OriginalSource.Tag
if ($ButtonInstall.IsEnabled -eq $false)
if (-not $ButtonInstall.IsEnabled)
{
$ButtonInstall.IsEnabled = $true
}
@ -9913,13 +9917,19 @@ function XboxGameBar
{
"Disable"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force
if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp))
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force
}
}
"Enable"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force
if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp))
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force
}
}
}
}
@ -10611,14 +10621,14 @@ function NetworkProtection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Disabled
}
@ -10668,14 +10678,14 @@ function PUAppsDetection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Disabled
}
@ -10728,14 +10738,14 @@ function DefenderSandbox
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 1
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 0
}
@ -11266,10 +11276,10 @@ function WindowsSandbox
{
"Disable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -11278,7 +11288,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -11292,10 +11302,10 @@ function WindowsSandbox
}
"Enable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}
@ -11304,7 +11314,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}

10
Sophia Script/Sophia Script for Windows 10/Sophia.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10"
Version: v5.12.9
Date: 15.12.2021
Version: v5.12.10
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -71,7 +71,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.9 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.12.10 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

10
Sophia Script/Sophia Script for Windows 11 PowerShell 7/Functions.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v6.0.10
Date: 15.12.2021
Version: v6.0.11
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.10 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.11 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

4
Sophia Script/Sophia Script for Windows 11 PowerShell 7/Manifest/Sophia.psd1

@ -1,9 +1,9 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '6.0.10'
ModuleVersion = '6.0.11'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2021 farag & Inestic. All rights reserved'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'
Description = 'Module for Windows fine-tuning and automating the routine tasks'
PowerShellVersion = '5.1'
ProcessorArchitecture = 'AMD64'

101
Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1

@ -2,11 +2,11 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v6.0.10
Date: 15.12.2021
Version: v6.0.11
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -4240,7 +4240,7 @@ function WaitNetworkStartup
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon"))
{
@ -4251,7 +4251,7 @@ function WaitNetworkStartup
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SyncForegroundPolicy -Force -ErrorAction Ignore
}
@ -5065,7 +5065,7 @@ function UpdateMicrosoftProducts
}
"Disable"
{
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService -eq $true)
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService)
{
(New-Object -ComObject Microsoft.Update.ServiceManager).RemoveService("7971f918-a847-4430-9279-4a52d1efe18d")
}
@ -7071,7 +7071,7 @@ function NetworkDiscovery
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled True
@ -7081,7 +7081,7 @@ function NetworkDiscovery
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled False
}
@ -8058,7 +8058,7 @@ function WSL
function RadioButtonChecked
{
$Global:CommandTag = $_.OriginalSource.Tag
if ($ButtonInstall.IsEnabled -eq $false)
if (-not $ButtonInstall.IsEnabled)
{
$ButtonInstall.IsEnabled = $true
}
@ -9387,13 +9387,19 @@ function XboxGameBar
{
"Disable"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force
if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp))
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force
}
}
"Enable"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force
if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp))
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force
}
}
}
}
@ -10085,14 +10091,14 @@ function NetworkProtection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Disabled
}
@ -10142,14 +10148,14 @@ function PUAppsDetection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Disabled
}
@ -10202,14 +10208,14 @@ function DefenderSandbox
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 1
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 0
}
@ -10740,10 +10746,10 @@ function WindowsSandbox
{
"Disable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -10752,7 +10758,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -10766,10 +10772,10 @@ function WindowsSandbox
}
"Enable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}
@ -10778,7 +10784,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}
@ -10830,16 +10836,16 @@ function DNSoverHTTPS
[switch]
$Enable,
[Parameter(Mandatory = $true)]
[Parameter(Mandatory = $false)]
[ValidateSet("1.0.0.1", "1.1.1.1", "149.112.112.112", "8.8.4.4", "8.8.8.8", "9.9.9.9")]
# Carve up the IPv4 addresses only
# Isolate the IPv4 addresses only
[ValidateScript({(@((Get-ChildItem -Path HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters\DohWellKnownServers).PSChildName) | Where-Object {$_ -notmatch ":"}) -contains $_})]
[string]
$PrimaryDNS,
[Parameter(Mandatory = $true)]
[Parameter(Mandatory = $false)]
[ValidateSet("1.0.0.1", "1.1.1.1", "149.112.112.112", "8.8.4.4", "8.8.8.8", "9.9.9.9")]
# Carve up the IPv4 addresses only
# Isolate the IPv4 addresses only
[ValidateScript({(@((Get-ChildItem -Path HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters\DohWellKnownServers).PSChildName) | Where-Object {$_ -notmatch ":"}) -contains $_})]
[string]
$SecondaryDNS,
@ -10856,12 +10862,24 @@ function DNSoverHTTPS
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
# Set the DNS servers
Get-NetAdapter -Physical | Get-NetIPInterface -AddressFamily IPv4 | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS
# Determining whether Hyper-V is enabled
# After enabling Hyper-V feature a virtual switch breing created, so we need to use different method to isolate the proper adapter
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
# Set a primary and secondary DNS servers
Get-NetAdapter -Physical | Get-NetIPInterface -AddressFamily IPv4 | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS
$InterfaceGuid = (Get-NetAdapter -Physical).InterfaceGuid
}
else
{
# Set a primary and secondary DNS servers
Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS
$InterfaceGuid = (Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter).InterfaceGuid
}
$InterfaceGuid = (Get-NetAdapter -Physical).InterfaceGuid
# Set the DNS servers
if (-not (Test-Path -Path "HKLM:\SYSTEM\ControlSet001\Services\Dnscache\InterfaceSpecificParameters\$InterfaceGuid\DohInterfaceSettings\Doh\$PrimaryDNS"))
{
New-Item -Path "HKLM:\SYSTEM\ControlSet001\Services\Dnscache\InterfaceSpecificParameters\$InterfaceGuid\DohInterfaceSettings\Doh\$PrimaryDNS" -Force
@ -10877,10 +10895,19 @@ function DNSoverHTTPS
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
# Configure the DNS servers automatically
Get-NetAdapter -Physical | Get-NetIPInterface -AddressFamily IPv4 | Set-DnsClientServerAddress -ResetServerAddresses
# Determining whether Hyper-V is enabled
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
# Configure DNS servers automatically
Get-NetAdapter -Physical | Get-NetIPInterface -AddressFamily IPv4 | Set-DnsClientServerAddress -ResetServerAddresses
}
else
{
# Configure DNS servers automatically
Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ResetServerAddresses
}
Remove-Item -Path "HKLM:\SYSTEM\ControlSet001\Services\Dnscache\InterfaceSpecificParameters\*" -Recurse -Force -ErrorAction Ignore
}

10
Sophia Script/Sophia Script for Windows 11 PowerShell 7/Sophia.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 11"
Version: v6.0.10
Date: 15.12.2021
Version: v6.0.11
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -70,7 +70,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.10 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.11 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

10
Sophia Script/Sophia Script for Windows 11/Functions.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v6.0.10
Date: 15.12.2021
Version: v6.0.11
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.10 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.11 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

4
Sophia Script/Sophia Script for Windows 11/Manifest/Sophia.psd1

@ -1,9 +1,9 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '6.0.10'
ModuleVersion = '6.0.11'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2021 farag & Inestic. All rights reserved'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'
Description = 'Module for Windows fine-tuning and automating the routine tasks'
PowerShellVersion = '5.1'
ProcessorArchitecture = 'AMD64'

101
Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1

@ -2,11 +2,11 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v6.0.10
Date: 15.12.2021
Version: v6.0.11
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -4210,7 +4210,7 @@ function WaitNetworkStartup
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
if (-not (Test-Path -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon"))
{
@ -4221,7 +4221,7 @@ function WaitNetworkStartup
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name SyncForegroundPolicy -Force -ErrorAction Ignore
}
@ -5034,7 +5034,7 @@ function UpdateMicrosoftProducts
}
"Disable"
{
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService -eq $true)
if (((New-Object -ComObject Microsoft.Update.ServiceManager).Services | Where-Object -FilterScript {$_.ServiceID -eq "7971f918-a847-4430-9279-4a52d1efe18d"}).IsDefaultAUService)
{
(New-Object -ComObject Microsoft.Update.ServiceManager).RemoveService("7971f918-a847-4430-9279-4a52d1efe18d")
}
@ -7038,7 +7038,7 @@ function NetworkDiscovery
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled True
@ -7048,7 +7048,7 @@ function NetworkDiscovery
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
Set-NetFirewallRule -Group $FirewallRules -Profile Private -Enabled False
}
@ -8025,7 +8025,7 @@ function WSL
function RadioButtonChecked
{
$Global:CommandTag = $_.OriginalSource.Tag
if ($ButtonInstall.IsEnabled -eq $false)
if (-not $ButtonInstall.IsEnabled)
{
$ButtonInstall.IsEnabled = $true
}
@ -9329,13 +9329,19 @@ function XboxGameBar
{
"Disable"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force
if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp))
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 0 -Force
}
}
"Enable"
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force
if ((Get-AppxPackage -Name Microsoft.XboxGamingOverlay) -or (Get-AppxPackage -Name Microsoft.GamingApp))
{
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -PropertyType DWord -Value 1 -Force
}
}
}
}
@ -10027,14 +10033,14 @@ function NetworkProtection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -EnableNetworkProtection Disabled
}
@ -10084,14 +10090,14 @@ function PUAppsDetection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
Set-MpPreference -PUAProtection Disabled
}
@ -10144,14 +10150,14 @@ function DefenderSandbox
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 1
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled -eq $true)
if ((Get-MpComputerStatus).AntivirusEnabled)
{
setx /M MP_FORCE_USE_SANDBOX 0
}
@ -10682,10 +10688,10 @@ function WindowsSandbox
{
"Disable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -10694,7 +10700,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Disable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -Online -NoRestart
}
@ -10708,10 +10714,10 @@ function WindowsSandbox
}
"Enable"
{
if (Get-WindowsEdition -Online | Where-Object -FilterScript {$_.Edition -eq "Professional" -or $_.Edition -like "Enterprise*"})
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*")})
{
# Checking whether x86 virtualization is enabled in the firmware
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled -eq $true)
if ((Get-CimInstance -ClassName CIM_Processor).VirtualizationFirmwareEnabled)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}
@ -10720,7 +10726,7 @@ function WindowsSandbox
try
{
# Determining whether Hyper-V is enabled
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent -eq $true)
if ((Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
Enable-WindowsOptionalFeature -FeatureName Containers-DisposableClientVM -All -Online -NoRestart
}
@ -10772,16 +10778,16 @@ function DNSoverHTTPS
[switch]
$Enable,
[Parameter(Mandatory = $true)]
[Parameter(Mandatory = $false)]
[ValidateSet("1.0.0.1", "1.1.1.1", "149.112.112.112", "8.8.4.4", "8.8.8.8", "9.9.9.9")]
# Carve up the IPv4 addresses only
# Isolate the IPv4 addresses only
[ValidateScript({(@((Get-ChildItem -Path HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters\DohWellKnownServers).PSChildName) | Where-Object {$_ -notmatch ":"}) -contains $_})]
[string]
$PrimaryDNS,
[Parameter(Mandatory = $true)]
[Parameter(Mandatory = $false)]
[ValidateSet("1.0.0.1", "1.1.1.1", "149.112.112.112", "8.8.4.4", "8.8.8.8", "9.9.9.9")]
# Carve up the IPv4 addresses only
# Isolate the IPv4 addresses only
[ValidateScript({(@((Get-ChildItem -Path HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters\DohWellKnownServers).PSChildName) | Where-Object {$_ -notmatch ":"}) -contains $_})]
[string]
$SecondaryDNS,
@ -10798,12 +10804,24 @@ function DNSoverHTTPS
{
"Enable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
# Set the DNS servers
Get-NetAdapter -Physical | Get-NetIPInterface -AddressFamily IPv4 | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS
# Determining whether Hyper-V is enabled
# After enabling Hyper-V feature a virtual switch breing created, so we need to use different method to isolate the proper adapter
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
# Set a primary and secondary DNS servers
Get-NetAdapter -Physical | Get-NetIPInterface -AddressFamily IPv4 | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS
$InterfaceGuid = (Get-NetAdapter -Physical).InterfaceGuid
}
else
{
# Set a primary and secondary DNS servers
Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ServerAddresses $PrimaryDNS, $SecondaryDNS
$InterfaceGuid = (Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter).InterfaceGuid
}
$InterfaceGuid = (Get-NetAdapter -Physical).InterfaceGuid
# Set the DNS servers
if (-not (Test-Path -Path "HKLM:\SYSTEM\ControlSet001\Services\Dnscache\InterfaceSpecificParameters\$InterfaceGuid\DohInterfaceSettings\Doh\$PrimaryDNS"))
{
New-Item -Path "HKLM:\SYSTEM\ControlSet001\Services\Dnscache\InterfaceSpecificParameters\$InterfaceGuid\DohInterfaceSettings\Doh\$PrimaryDNS" -Force
@ -10819,10 +10837,19 @@ function DNSoverHTTPS
}
"Disable"
{
if ((Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain -eq $false)
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).PartOfDomain)
{
# Configure the DNS servers automatically
Get-NetAdapter -Physical | Get-NetIPInterface -AddressFamily IPv4 | Set-DnsClientServerAddress -ResetServerAddresses
# Determining whether Hyper-V is enabled
if (-not (Get-CimInstance -ClassName CIM_ComputerSystem).HypervisorPresent)
{
# Configure DNS servers automatically
Get-NetAdapter -Physical | Get-NetIPInterface -AddressFamily IPv4 | Set-DnsClientServerAddress -ResetServerAddresses
}
else
{
# Configure DNS servers automatically
Get-NetRoute | Where-Object -FilterScript {$_.DestinationPrefix -eq "0.0.0.0/0"} | Get-NetAdapter | Set-DnsClientServerAddress -ResetServerAddresses
}
Remove-Item -Path "HKLM:\SYSTEM\ControlSet001\Services\Dnscache\InterfaceSpecificParameters\*" -Recurse -Force -ErrorAction Ignore
}

10
Sophia Script/Sophia Script for Windows 11/Sophia.ps1

@ -2,11 +2,11 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 11"
Version: v6.0.10
Date: 15.12.2021
Version: v6.0.11
Date: 31.12.2021
Copyright (c) 20142021 farag
Copyright (c) 20192021 farag & Inestic
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
Thanks to all https://forum.ru-board.com members involved
@ -70,7 +70,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.10 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2021"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.0.11 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force

4
sophia_script_versions.json

@ -3,7 +3,7 @@
"Sophia_Script_Windows_10_PowerShell_7": "5.12.9",
"Sophia_Script_Windows_10_LTSC2019": "5.2.19",
"Sophia_Script_Windows_10_LTSC2021": "5.12.9",
"Sophia_Script_Windows_11_PowerShell_5_1": "6.0.10",
"Sophia_Script_Windows_11_PowerShell_7": "6.0.10",
"Sophia_Script_Windows_11_PowerShell_5_1": "6.0.11",
"Sophia_Script_Windows_11_PowerShell_7": "6.0.11",
"Sophia_Script_Wrapper": "2.5.3"
}

Loading…
Cancel
Save