Browse Source

6.1.3 — 26.07.2022

pull/378/head
Dmitry Nefedov 2 years ago
parent
commit
854dab31fb
  1. 6
      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. 80
      Sophia Script/Sophia Script for Windows 10 LTSC 2019/Module/Sophia.psm1
  4. 6
      Sophia Script/Sophia Script for Windows 10 LTSC 2019/Sophia.ps1
  5. 6
      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. 84
      Sophia Script/Sophia Script for Windows 10 LTSC 2021/Module/Sophia.psm1
  8. 6
      Sophia Script/Sophia Script for Windows 10 LTSC 2021/Sophia.ps1
  9. 6
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Functions.ps1
  10. 2
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Manifest/Sophia.psd1
  11. 100
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Module/Sophia.psm1
  12. 6
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/Sophia.ps1
  13. 6
      Sophia Script/Sophia Script for Windows 10/Functions.ps1
  14. 2
      Sophia Script/Sophia Script for Windows 10/Manifest/Sophia.psd1
  15. 86
      Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1
  16. 6
      Sophia Script/Sophia Script for Windows 10/Sophia.ps1
  17. 6
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Functions.ps1
  18. 2
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Manifest/Sophia.psd1
  19. 73
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1
  20. 6
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Sophia.ps1
  21. 6
      Sophia Script/Sophia Script for Windows 11/Functions.ps1
  22. 2
      Sophia Script/Sophia Script for Windows 11/Manifest/Sophia.psd1
  23. 59
      Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1
  24. 6
      Sophia Script/Sophia Script for Windows 11/Sophia.ps1
  25. BIN
      Wrapper/SophiaScriptWrapper.exe

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

@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.3.2
Date: 16.07.2022
Version: v5.3.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.3.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.3.3 | 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

@ -1,6 +1,6 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.3.2'
ModuleVersion = '5.3.3'
GUID = 'a36a65ca-70f9-43df-856c-3048fc5e7f01'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

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

@ -2,8 +2,8 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.3.2
Date: 16.07.2022
Version: v5.3.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -74,51 +74,40 @@ function Checkings
{
Write-Warning -Message $Localization.UnsupportedOSBuild
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Sleep -Seconds 1
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Sleep -Seconds 1
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Process -FilePath "https://t.me/sophia_chat"
exit
}
}
# Check whether the OS minor build version is 3046 minimum
# https://docs.microsoft.com/en-us/windows/release-health/release-information
# https://support.microsoft.com/en-us/topic/windows-10-and-windows-server-2019-update-history-725fc2e1-4443-6831-a5ca-51ff5cbcb059
switch ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 3046)
{
$false
$true
{
$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR
Write-Warning -Message ($Localization.UpdateWarning -f $Version)
if (-not ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 3046))
{
# Check whether the OS minor build version is 3046 minimum
# https://docs.microsoft.com/en-us/windows/release-health/release-information
# https://support.microsoft.com/en-us/topic/windows-10-and-windows-server-2019-update-history-725fc2e1-4443-6831-a5ca-51ff5cbcb059
$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR
Write-Warning -Message ($Localization.UpdateWarning -f $Version)
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Process -FilePath "https://t.me/sophia_chat"
Start-Sleep -Seconds 1
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Sleep -Seconds 1
Start-Sleep -Seconds 1
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Process -FilePath "https://t.me/sophia_chat"
Start-Sleep -Seconds 1
exit
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
exit
}
}
}
@ -292,6 +281,7 @@ function Checkings
catch [Microsoft.Management.Infrastructure.CimException]
{
# Provider Load Failure exception
$Localization.DefenderBroken
$Global:Error.Exception[-1]
Start-Process -FilePath "https://t.me/sophia_chat"
@ -319,7 +309,7 @@ function Checkings
}
else
{
if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running")
if ((Get-Service -Name $_).Status -eq "running")
{
$Script:DefenderServices = $true
}
@ -9453,9 +9443,7 @@ function MultipleInvokeContext
#>
function UpdateLGPEPolicies
{
if (-not (Get-WindowsEdition -Online | Where-Object -FilterScript {
($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")
}))
if (-not (Test-Path -Path "$env:SystemRoot\System32\gpedit.msc"))
{
return
}
@ -9482,9 +9470,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_LOCAL_MACHINE\", "HKLM:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{
@ -9530,9 +9521,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_CURRENT_USER\", "HKCU:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{

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

@ -2,8 +2,8 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10 LTSC 2019"
Version: v5.3.2
Date: 16.07.2022
Version: v5.3.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -71,7 +71,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.3.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2019 v5.3.3 | 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

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

@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.13.2
Date: 16.07.2022
Version: v5.13.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.13.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.13.3 | 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

@ -1,6 +1,6 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.13.2'
ModuleVersion = '5.13.3'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

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

@ -2,8 +2,8 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.13.2
Date: 16.07.2022
Version: v5.13.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -74,51 +74,40 @@ function Checkings
{
Write-Warning -Message $Localization.UnsupportedOSBuild
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Sleep -Seconds 1
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Sleep -Seconds 1
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Process -FilePath "https://t.me/sophia_chat"
exit
}
}
# Check whether the OS minor build version is 1766 minimum
# https://docs.microsoft.com/en-us/windows/release-health/release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014699-os-builds-19042-1766-19043-1766-and-19044-1766-5c81d49d-0b6e-4808-9485-1f54e5d1bb15
switch ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 1766)
{
$false
$true
{
$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR
Write-Warning -Message ($Localization.UpdateWarning -f $Version)
# Check whether the OS minor build version is 1766 minimum
# https://docs.microsoft.com/en-us/windows/release-health/release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014699-os-builds-19042-1766-19043-1766-and-19044-1766-5c81d49d-0b6e-4808-9485-1f54e5d1bb15
if (-not ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 1766))
{
$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR
Write-Warning -Message ($Localization.UpdateWarning -f $Version)
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Process -FilePath "https://t.me/sophia_chat"
Start-Sleep -Seconds 1
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Sleep -Seconds 1
Start-Sleep -Seconds 1
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Process -FilePath "https://t.me/sophia_chat"
Start-Sleep -Seconds 1
exit
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
exit
}
}
}
@ -292,6 +281,7 @@ function Checkings
catch [Microsoft.Management.Infrastructure.CimException]
{
# Provider Load Failure exception
$Localization.DefenderBroken
$Global:Error.Exception[-1]
Start-Process -FilePath "https://t.me/sophia_chat"
@ -319,7 +309,7 @@ function Checkings
}
else
{
if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running")
if ((Get-Service -Name $_).Status -eq "running")
{
$Script:DefenderServices = $true
}
@ -8980,14 +8970,14 @@ function NetworkProtection
{
"Enable"
{
if ((Get-MpComputerStatus).AntivirusEnabled)
if ($Script:DefenderEnabled)
{
Set-MpPreference -EnableNetworkProtection Enabled
}
}
"Disable"
{
if ((Get-MpComputerStatus).AntivirusEnabled)
if ($Script:DefenderEnabled)
{
Set-MpPreference -EnableNetworkProtection Disabled
}
@ -10610,9 +10600,7 @@ function MultipleInvokeContext
#>
function UpdateLGPEPolicies
{
if (-not (Get-WindowsEdition -Online | Where-Object -FilterScript {
($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")
}))
if (-not (Test-Path -Path "$env:SystemRoot\System32\gpedit.msc"))
{
return
}
@ -10639,9 +10627,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_LOCAL_MACHINE\", "HKLM:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{
@ -10687,9 +10678,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_CURRENT_USER\", "HKCU:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{

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

@ -2,8 +2,8 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10 LTSC 2021"
Version: v5.13.2
Date: 16.07.2022
Version: v5.13.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -71,7 +71,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.13.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 LTSC 2021 v5.13.3 | 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

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

@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.13.2
Date: 16.07.2022
Version: v5.13.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.2 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.3 (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

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

@ -1,6 +1,6 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.13.2'
ModuleVersion = '5.13.3'
GUID = 'aa0b47a7-1770-4b5d-8c9f-cc6c505bcc7a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

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

@ -2,8 +2,8 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.13.2
Date: 16.07.2022
Version: v5.13.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -74,57 +74,40 @@ function Checkings
{
Write-Warning -Message $Localization.UnsupportedOSBuild
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Sleep -Seconds 1
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Sleep -Seconds 1
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Process -FilePath "https://t.me/sophia_chat"
exit
}
}
# Check whether the OS minor build version is 1766 minimum
# https://docs.microsoft.com/en-us/windows/release-health/release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014699-os-builds-19042-1766-19043-1766-and-19044-1766-5c81d49d-0b6e-4808-9485-1f54e5d1bb15
switch ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 1766)
{
$false
$true
{
$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR
Write-Warning -Message ($Localization.UpdateWarning -f $Version)
if (-not ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 1766))
{
# Check whether the OS minor build version is 1766 minimum
# https://docs.microsoft.com/en-us/windows/release-health/release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014699-os-builds-19042-1766-19043-1766-and-19044-1766-5c81d49d-0b6e-4808-9485-1f54e5d1bb15
$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR
Write-Warning -Message ($Localization.UpdateWarning -f $Version)
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Process -FilePath "https://t.me/sophia_chat"
Start-Sleep -Seconds 1
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
Start-Sleep -Seconds 1
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
Start-Sleep -Seconds 1
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Sleep -Seconds 1
Start-Process -FilePath "https://t.me/sophia_chat"
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
exit
exit
}
}
}
@ -300,6 +283,7 @@ function Checkings
catch [Microsoft.Management.Infrastructure.CimException]
{
# Provider Load Failure exception
$Localization.DefenderBroken
$Global:Error.Exception[-1]
Start-Process -FilePath "https://t.me/sophia_chat"
@ -327,7 +311,7 @@ function Checkings
}
else
{
if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running")
if ((Get-Service -Name $_).Status -eq "running")
{
$Script:DefenderServices = $true
}
@ -494,16 +478,12 @@ function CreateRestorePoint
$SystemDriveUniqueID = (Get-Volume | Where-Object -FilterScript {$_.DriveLetter -eq "$($env:SystemDrive[0])"}).UniqueID
$SystemProtection = ((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SPP\Clients" -ErrorAction Ignore)."{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513}") | Where-Object -FilterScript {$_ -match [regex]::Escape($SystemDriveUniqueID)}
$ComputerRestorePoint = $false
switch ($null -eq $SystemProtection)
{
$true
{
$ComputerRestorePoint = $true
$Script:ComputerRestorePoint = $false
$SystemProtection ?? (& {
$Script:ComputerRestorePoint = $true
Enable-ComputerRestore -Drive $env:SystemDrive
}
}
)
# Never skip creating a restore point
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name SystemRestorePointCreationFrequency -PropertyType DWord -Value 0 -Force
@ -514,7 +494,7 @@ function CreateRestorePoint
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name SystemRestorePointCreationFrequency -PropertyType DWord -Value 1440 -Force
# Turn off System Protection for the system drive if it was turned off before without deleting the existing restore points
if ($ComputerRestorePoint)
if ($Script:ComputerRestorePoint)
{
Disable-ComputerRestore -Drive $env:SystemDrive
}
@ -10506,7 +10486,7 @@ function CheckUWPAppsUpdates
XboxGameBar -Enable
.NOTES
To prevent popping up the "You'll need a new app to open this `ms-gamingoverlay`" warning, you need to disable the `Xbox Game Bar` app, even if you uninstalled it before.
To prevent popping up the "You'll need a new app to open this ms-gamingoverlay" warning, you need to disable the `Xbox Game Bar` app, even if you uninstalled it before.
.NOTES
Current user
@ -13041,9 +13021,7 @@ function UseStoreOpenWith
#>
function UpdateLGPEPolicies
{
if (-not (Get-WindowsEdition -Online | Where-Object -FilterScript {
($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")
}))
if (-not (Test-Path -Path "$env:SystemRoot\System32\gpedit.msc"))
{
return
}
@ -13070,9 +13048,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_LOCAL_MACHINE\", "HKLM:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{
@ -13118,9 +13099,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_CURRENT_USER\", "HKCU:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{

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

@ -2,8 +2,8 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10 (PowerShell 7)"
Version: v5.13.2
Date: 16.07.2022
Version: v5.13.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -71,7 +71,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.2 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.3 (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

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

@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v5.13.2
Date: 16.07.2022
Version: v5.13.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.3 | 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/Manifest/Sophia.psd1

@ -1,6 +1,6 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '5.13.2'
ModuleVersion = '5.13.3'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

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

@ -2,8 +2,8 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v5.13.2
Date: 16.07.2022
Version: v5.13.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -74,57 +74,40 @@ function Checkings
{
Write-Warning -Message $Localization.UnsupportedOSBuild
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Sleep -Seconds 1
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Sleep -Seconds 1
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Process -FilePath "https://t.me/sophia_chat"
exit
}
}
# Check whether the OS minor build version is 1766 minimum
# https://docs.microsoft.com/en-us/windows/release-health/release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014699-os-builds-19042-1766-19043-1766-and-19044-1766-5c81d49d-0b6e-4808-9485-1f54e5d1bb15
switch ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 1766)
{
$false
$true
{
$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR
Write-Warning -Message ($Localization.UpdateWarning -f $Version)
# Check whether the OS minor build version is 1766 minimum
# https://docs.microsoft.com/en-us/windows/release-health/release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014699-os-builds-19042-1766-19043-1766-and-19044-1766-5c81d49d-0b6e-4808-9485-1f54e5d1bb15
if (-not ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 1766))
{
$Version = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR
Write-Warning -Message ($Localization.UpdateWarning -f $Version)
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Process -FilePath "https://t.me/sophia_chat"
Start-Sleep -Seconds 1
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
Start-Sleep -Seconds 1
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
Start-Sleep -Seconds 1
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Sleep -Seconds 1
Start-Process -FilePath "https://t.me/sophia_chat"
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
exit
exit
}
}
}
@ -298,6 +281,7 @@ function Checkings
catch [Microsoft.Management.Infrastructure.CimException]
{
# Provider Load Failure exception
$Localization.DefenderBroken
$Global:Error.Exception[-1]
Start-Process -FilePath "https://t.me/sophia_chat"
@ -325,7 +309,7 @@ function Checkings
}
else
{
if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running")
if ((Get-Service -Name $_).Status -eq "running")
{
$Script:DefenderServices = $true
}
@ -10465,7 +10449,7 @@ function CheckUWPAppsUpdates
XboxGameBar -Enable
.NOTES
To prevent popping up the "You'll need a new app to open this `ms-gamingoverlay`" warning, you need to disable the `Xbox Game Bar` app, even if you uninstalled it before.
To prevent popping up the "You'll need a new app to open this ms-gamingoverlay" warning, you need to disable the `Xbox Game Bar` app, even if you uninstalled it before.
.NOTES
Current user
@ -12998,9 +12982,7 @@ function UseStoreOpenWith
#>
function UpdateLGPEPolicies
{
if (-not (Get-WindowsEdition -Online | Where-Object -FilterScript {
($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")
}))
if (-not (Test-Path -Path "$env:SystemRoot\System32\gpedit.msc"))
{
return
}
@ -13027,9 +13009,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_LOCAL_MACHINE\", "HKLM:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{
@ -13075,9 +13060,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_CURRENT_USER\", "HKCU:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{

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

@ -2,8 +2,8 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 10"
Version: v5.13.2
Date: 16.07.2022
Version: v5.13.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -71,7 +71,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 10 v5.13.3 | 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

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

@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v6.1.2
Date: 16.07.2022
Version: v6.1.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.1.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.1.3 | 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 11 PowerShell 7/Manifest/Sophia.psd1

@ -1,6 +1,6 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '6.1.2'
ModuleVersion = '6.1.3'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

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

@ -2,8 +2,8 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v6.1.2
Date: 16.07.2022
Version: v6.1.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -63,40 +63,22 @@ function Checkings
{
Write-Warning -Message $Localization.UnsupportedOSBuild
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Sleep -Seconds 1
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Sleep -Seconds 1
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Process -FilePath "https://t.me/sophia_chat"
exit
}
}
# Check whether the OS minor build version is 739 minimum
# https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014697-os-build-22000-739-cd3aaa0b-a8da-44a0-a778-dfb6f1d9ea11
switch ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 739)
{
$false
$true
{
if ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -eq 22000)
# Check whether the OS minor build version is 739 minimum
# https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014697-os-build-22000-739-cd3aaa0b-a8da-44a0-a778-dfb6f1d9ea11
if (-not ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 739))
{
$Version = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion"
Write-Warning -Message ($Localization.UpdateWarning -f $Version.CurrentBuild, $Version.UBR)
Start-Process -FilePath "https://t.me/sophia_chat"
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
@ -113,8 +95,6 @@ function Checkings
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Process -FilePath "https://t.me/sophia_chat"
exit
}
}
@ -293,6 +273,7 @@ function Checkings
catch [Microsoft.Management.Infrastructure.CimException]
{
# Provider Load Failure exception
$Localization.DefenderBroken
$Global:Error.Exception[-1]
Start-Process -FilePath "https://t.me/sophia_chat"
@ -320,7 +301,7 @@ function Checkings
}
else
{
if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running")
if ((Get-Service -Name $_).Status -eq "running")
{
$Script:DefenderServices = $true
}
@ -487,16 +468,12 @@ function CreateRestorePoint
$SystemDriveUniqueID = (Get-Volume | Where-Object -FilterScript {$_.DriveLetter -eq "$($env:SystemDrive[0])"}).UniqueID
$SystemProtection = ((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SPP\Clients" -ErrorAction Ignore)."{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513}") | Where-Object -FilterScript {$_ -match [regex]::Escape($SystemDriveUniqueID)}
$ComputerRestorePoint = $false
switch ($null -eq $SystemProtection)
{
$true
{
$ComputerRestorePoint = $true
$Script:ComputerRestorePoint = $false
$SystemProtection ?? (& {
$Script:ComputerRestorePoint = $true
Enable-ComputerRestore -Drive $env:SystemDrive
}
}
)
# Never skip creating a restore point
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name SystemRestorePointCreationFrequency -PropertyType DWord -Value 0 -Force
@ -507,7 +484,7 @@ function CreateRestorePoint
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name SystemRestorePointCreationFrequency -PropertyType DWord -Value 1440 -Force
# Turn off System Protection for the system drive if it was turned off before without deleting the existing restore points
if ($ComputerRestorePoint)
if ($Script:ComputerRestorePoint)
{
Disable-ComputerRestore -Drive $env:SystemDrive
}
@ -12463,9 +12440,7 @@ function Windows10ContextMenu
#>
function UpdateLGPEPolicies
{
if (-not (Get-WindowsEdition -Online | Where-Object -FilterScript {
($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")
}))
if (-not (Test-Path -Path "$env:SystemRoot\System32\gpedit.msc"))
{
return
}
@ -12492,9 +12467,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_LOCAL_MACHINE\", "HKLM:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{
@ -12540,9 +12518,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_CURRENT_USER\", "HKCU:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{

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

@ -2,8 +2,8 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 11 (PowerShell 7)"
Version: v6.1.2
Date: 16.07.2022
Version: v6.1.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -70,7 +70,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.1.2 (PowerShell 7) | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.1.3 (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

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

@ -2,8 +2,8 @@
.SYNOPSIS
The TAB completion for functions and their arguments
Version: v6.1.2
Date: 16.07.2022
Version: v6.1.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -54,7 +54,7 @@ function Sophia
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.1.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.1.3 | 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 11/Manifest/Sophia.psd1

@ -1,6 +1,6 @@
@{
RootModule = '..\Module\Sophia.psm1'
ModuleVersion = '6.1.2'
ModuleVersion = '6.1.3'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

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

@ -2,8 +2,8 @@
.SYNOPSIS
Sophia Script is a PowerShell module for Windows 10 & Windows 11 fine-tuning and automating the routine tasks
Version: v6.1.2
Date: 16.07.2022
Version: v6.1.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -63,40 +63,22 @@ function Checkings
{
Write-Warning -Message $Localization.UnsupportedOSBuild
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
Start-Sleep -Seconds 1
# Check for UWP apps updates
Get-CimInstance -Namespace "Root\cimv2\mdm\dmmap" -ClassName "MDM_EnterpriseModernAppManagement_AppManagement01" | Invoke-CimMethod -MethodName UpdateScanMethod
# Open the "Windows Update" page
Start-Process -FilePath "ms-settings:windowsupdate-action"
Start-Sleep -Seconds 1
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Process -FilePath "https://t.me/sophia_chat"
exit
}
}
# Check whether the OS minor build version is 739 minimum
# https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014697-os-build-22000-739-cd3aaa0b-a8da-44a0-a778-dfb6f1d9ea11
switch ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 739)
{
$false
$true
{
if ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -eq 22000)
# Check whether the OS minor build version is 739 minimum
# https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information
# https://support.microsoft.com/en-us/topic/june-14-2022-kb5014697-os-build-22000-739-cd3aaa0b-a8da-44a0-a778-dfb6f1d9ea11
if (-not ((Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion" -Name UBR) -ge 739))
{
$Version = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion"
Write-Warning -Message ($Localization.UpdateWarning -f $Version.CurrentBuild, $Version.UBR)
Start-Process -FilePath "https://t.me/sophia_chat"
# Enable receiving updates for other Microsoft products when you update Windows
(New-Object -ComObject Microsoft.Update.ServiceManager).AddService2("7971f918-a847-4430-9279-4a52d1efe18d", 7, "")
@ -113,8 +95,6 @@ function Checkings
# Trigger Windows Update for detecting new updates
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()
Start-Process -FilePath "https://t.me/sophia_chat"
exit
}
}
@ -291,6 +271,7 @@ function Checkings
catch [Microsoft.Management.Infrastructure.CimException]
{
# Provider Load Failure exception
$Localization.DefenderBroken
$Global:Error.Exception[-1]
Start-Process -FilePath "https://t.me/sophia_chat"
@ -318,7 +299,7 @@ function Checkings
}
else
{
if ((Get-Service -Name $_ -ErrorAction Ignore).Status -eq "running")
if ((Get-Service -Name $_).Status -eq "running")
{
$Script:DefenderServices = $true
}
@ -12422,9 +12403,7 @@ function Windows10ContextMenu
#>
function UpdateLGPEPolicies
{
if (-not (Get-WindowsEdition -Online | Where-Object -FilterScript {
($_.Edition -eq "Professional") -or ($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")
}))
if (-not (Test-Path -Path "$env:SystemRoot\System32\gpedit.msc"))
{
return
}
@ -12451,9 +12430,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_LOCAL_MACHINE\", "HKLM:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{
@ -12499,9 +12481,12 @@ function UpdateLGPEPolicies
[xml]$config = Get-Content -Path $admx.FullName -Encoding UTF8
$SplitPath = Split-Path -Path $Path.Name.Replace("HKEY_CURRENT_USER\", "HKCU:") -NoQualifier
if ($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
if (($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath) -and ($_.valueName -eq $Item) -or (($_.key -eq $SplitPath) -and ($_.Name -eq $Item))
})
}) -or
($config.policyDefinitions.policies.policy | Where-Object -FilterScript {
($_.key -eq $SplitPath)
} | Where-Object -FilterScript {$_.elements.enum.valueName -eq $Item}))
{
try
{

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

@ -2,8 +2,8 @@
.SYNOPSIS
Default preset file for "Sophia Script for Windows 11"
Version: v6.1.2
Date: 16.07.2022
Version: v6.1.3
Date: 26.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -70,7 +70,7 @@ param
Clear-Host
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.1.2 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows | $([char]0x00A9) farag & Inestic, 2014$([char]0x2013)2022"
$Host.UI.RawUI.WindowTitle = "Sophia Script for Windows 11 v6.1.3 | 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

BIN
Wrapper/SophiaScriptWrapper.exe

Binary file not shown.
Loading…
Cancel
Save