Browse Source

6.1.1 — 05.07.2022

pull/378/head
Dmitry Nefedov 3 years ago
parent
commit
0d3055e6ab
  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. 61
      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. 127
      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. 66
      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. BIN
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/bin/Microsoft.Windows.SDK.NET.dll
  14. BIN
      Sophia Script/Sophia Script for Windows 10 PowerShell 7/bin/WinRT.Runtime.dll
  15. 6
      Sophia Script/Sophia Script for Windows 10/Functions.ps1
  16. 2
      Sophia Script/Sophia Script for Windows 10/Manifest/Sophia.psd1
  17. 60
      Sophia Script/Sophia Script for Windows 10/Module/Sophia.psm1
  18. 6
      Sophia Script/Sophia Script for Windows 10/Sophia.ps1
  19. 6
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Functions.ps1
  20. 2
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Manifest/Sophia.psd1
  21. 64
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Module/Sophia.psm1
  22. 1332
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/Sophia.ps1
  23. BIN
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/bin/Microsoft.Windows.SDK.NET.dll
  24. BIN
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/bin/Start_Layout/start.bin
  25. BIN
      Sophia Script/Sophia Script for Windows 11 PowerShell 7/bin/WinRT.Runtime.dll
  26. 6
      Sophia Script/Sophia Script for Windows 11/Functions.ps1
  27. 2
      Sophia Script/Sophia Script for Windows 11/Manifest/Sophia.psd1
  28. 51
      Sophia Script/Sophia Script for Windows 11/Module/Sophia.psm1
  29. 6
      Sophia Script/Sophia Script for Windows 11/Sophia.ps1
  30. BIN
      Sophia Script/Sophia Script for Windows 11/bin/Start_Layout/start.bin
  31. 2
      Wrapper/Config/config_Windows_10.json
  32. 2
      Wrapper/Config/config_Windows_10_LTSC.json
  33. 2
      Wrapper/Config/config_Windows_11.json
  34. 2207
      Wrapper/Localizations/it-IT/tooltip_Windows_10.json
  35. 1992
      Wrapper/Localizations/it-IT/tooltip_Windows_11.json
  36. 70
      Wrapper/Localizations/it-IT/ui.json
  37. 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.0
Date: 04.07.2022
Version: v5.3.1
Date: 05.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 v5.3.0 | 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 v5.3.1 | 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.0'
ModuleVersion = '5.3.1'
GUID = 'a36a65ca-70f9-43df-856c-3048fc5e7f01'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

61
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.0
Date: 04.07.2022
Version: v5.3.1
Date: 05.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -211,7 +211,7 @@ function Checkings
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/sophia_script_versions.json"
UseBasicParsing = $true
}
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_5_1
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC2019
$CurrentRelease = (Get-Module -Name Sophia).Version.ToString()
switch ([System.Version]$LatestRelease -gt [System.Version]$CurrentRelease)
{
@ -457,6 +457,10 @@ function DiagnosticDataLevel
"Minimal"
{
# Security level
if (-not (Test-Path -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection))
{
New-Item -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Force
}
New-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 1 -Force
@ -4389,6 +4393,11 @@ function NetworkAdaptersSavePower
$Enable
)
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
}
$Adapters = Get-NetAdapter -Physical | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
switch ($PSCmdlet.ParameterSetName)
@ -4411,14 +4420,17 @@ function NetworkAdaptersSavePower
}
}
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up.
# Otherwise functions below will indicate that there is not the Internet connection.
while
(
Get-NetAdapter -Physical | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up
# Otherwise functions below will indicate that there is no the Internet connection
if ($PhysicalAdaptersStatusUp)
{
Start-Sleep -Milliseconds 100
while
(
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
{
Start-Sleep -Seconds 2
}
}
}
@ -6867,15 +6879,15 @@ function InstallDotNetRuntime6
{
# https://github.com/dotnet/core/blob/main/release-notes/releases-index.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json"
UseBasicParsing = $true
Uri = "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/6.0/releases.json"
UseBasicParsing = $true
}
$LatestRelease = ((Invoke-RestMethod @Parameters)."releases-index" | Where-Object -FilterScript {$_."channel-version" -eq "6.0"})."latest-release"
$LatestRelease = (Invoke-RestMethod @Parameters)."latest-release"
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
# .NET Desktop Runtime x86
$Parameters = @{
Uri = "https://dotnetcli.azureedge.net/dotnet/Runtime/$LatestRelease/dotnet-runtime-$LatestRelease-win-x64.exe"
Uri = "https://dotnetcli.azureedge.net/dotnet/Runtime/$LatestRelease/dotnet-runtime-$LatestRelease-win-x86.exe"
OutFile = "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x86.exe"
UseBasicParsing = $true
Verbose = $true
@ -6886,7 +6898,7 @@ function InstallDotNetRuntime6
# .NET Desktop Runtime x64
$Parameters = @{
Uri = "https://dotnetcli.azureedge.net/dotnet/Runtime/$LatestRelease/dotnet-runtime-$LatestRelease-win-x86.exe"
Uri = "https://dotnetcli.azureedge.net/dotnet/Runtime/$LatestRelease/dotnet-runtime-$LatestRelease-win-x64.exe"
OutFile = "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x64.exe"
UseBasicParsing = $true
Verbose = $true
@ -6904,7 +6916,7 @@ function InstallDotNetRuntime6
(Get-ItemProperty -Path HKCU:\Environment -Name TEMP).TEMP
[System.IO.Path]::GetTempPath()
#>
Get-ChildItem -Path "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x86.exe", "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x64.exe", "$env:TEMP\Microsoft_.NET_Runtime_*.log" -Force | Remove-Item -Recurse -Force -ErrorAction Ignore
Get-ChildItem -Path "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x86.exe", "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x64.exe", "$env:TEMP\Microsoft_Windows_Desktop_Runtime*.log" -Force | Remove-Item -Recurse -Force -ErrorAction Ignore
}
}
catch [System.Net.WebException]
@ -9216,8 +9228,8 @@ function MultipleInvokeContext
#>
function UpdateLGPEPolicies
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose
Write-Information -MessageData "" -InformationAction Continue
# Local Machine policies paths to scan recursively
$LM_Paths = @(
@ -9244,7 +9256,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -9293,7 +9304,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -9317,6 +9327,19 @@ function UpdateLGPEPolicies
}
}
# Re-build GPT.ini if it doesn't exist
if (-not (Test-Path -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini))
{
Start-Process -FilePath gpedit.msc
Start-Sleep -Seconds 2
# Get mmc.exe's Id with its' argument (gpedit.msc) to close
$gpedit_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {
$_.Name -eq "mmc.exe"
} | Where-Object -FilterScript {$_.CommandLine -match "GPEDIT.MSC"}).Handle
Get-Process -Id $gpedit_Process_ID | Stop-Process -Force
}
Update-GptIniVersion -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini -PolicyType Machine, User
# Apply the new policy immediately

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.0
Date: 04.07.2022
Version: v5.3.1
Date: 05.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 v5.3.0 | 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 v5.3.1 | 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.0
Date: 04.07.2022
Version: v5.13.1
Date: 05.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.0 | 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.1 | 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.0'
ModuleVersion = '5.13.1'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

127
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.0
Date: 04.07.2022
Version: v5.13.1
Date: 05.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -68,7 +68,7 @@ function Checkings
}
# Detect the OS build version
switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -eq 19048)
switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -eq 19044)
{
$false
{
@ -239,7 +239,7 @@ function Checkings
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/sophia_script_versions.json"
UseBasicParsing = $true
}
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_5_1
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC2021
$CurrentRelease = (Get-Module -Name Sophia).Version.ToString()
switch ([System.Version]$LatestRelease -gt [System.Version]$CurrentRelease)
{
@ -485,6 +485,10 @@ function DiagnosticDataLevel
"Minimal"
{
# Security level
if (-not (Test-Path -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection))
{
New-Item -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Force
}
New-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 0 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 1 -Force
@ -4747,6 +4751,11 @@ function NetworkAdaptersSavePower
$Enable
)
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
}
$Adapters = Get-NetAdapter -Physical | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
switch ($PSCmdlet.ParameterSetName)
@ -4769,14 +4778,17 @@ function NetworkAdaptersSavePower
}
}
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up.
# Otherwise functions below will indicate that there is not the Internet connection.
while
(
Get-NetAdapter -Physical | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up
# Otherwise functions below will indicate that there is no the Internet connection
if ($PhysicalAdaptersStatusUp)
{
Start-Sleep -Milliseconds 100
while
(
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
{
Start-Sleep -Seconds 2
}
}
}
@ -7448,56 +7460,46 @@ function InstallDotNetRuntime6
return
}
if (Get-AppxPackage -Name Microsoft.DesktopAppInstaller)
{
# .NET Desktop Runtime x86
winget install --id=Microsoft.DotNet.DesktopRuntime.6 --architecture x86 --exact --accept-source-agreements
# .NET Desktop Runtime x64
winget install --id=Microsoft.DotNet.DesktopRuntime.6 --architecture x64 --exact --accept-source-agreements
# https://github.com/dotnet/core/blob/main/release-notes/releases-index.json
$Parameters = @{
Uri = "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/6.0/releases.json"
UseBasicParsing = $true
}
else
{
# https://github.com/dotnet/core/blob/main/release-notes/releases-index.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json"
UseBasicParsing = $true
}
$LatestRelease = ((Invoke-RestMethod @Parameters)."releases-index" | Where-Object -FilterScript {$_."channel-version" -eq "6.0"})."latest-release"
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
$LatestRelease = (Invoke-RestMethod @Parameters)."latest-release"
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
# .NET Desktop Runtime x86
$Parameters = @{
Uri = "https://dotnetcli.azureedge.net/dotnet/Runtime/$LatestRelease/dotnet-runtime-$LatestRelease-win-x64.exe"
OutFile = "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x86.exe"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
# .NET Desktop Runtime x86
$Parameters = @{
Uri = "https://dotnetcli.azureedge.net/dotnet/Runtime/$LatestRelease/dotnet-runtime-$LatestRelease-win-x86.exe"
OutFile = "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x86.exe"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
Start-Process -FilePath "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x86.exe" -ArgumentList "/install /passive /norestart" -Wait
Start-Process -FilePath "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x86.exe" -ArgumentList "/install /passive /norestart" -Wait
# .NET Desktop Runtime x64
$Parameters = @{
Uri = "https://dotnetcli.azureedge.net/dotnet/Runtime/$LatestRelease/dotnet-runtime-$LatestRelease-win-x86.exe"
OutFile = "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x64.exe"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
# .NET Desktop Runtime x64
$Parameters = @{
Uri = "https://dotnetcli.azureedge.net/dotnet/Runtime/$LatestRelease/dotnet-runtime-$LatestRelease-win-x64.exe"
OutFile = "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x64.exe"
UseBasicParsing = $true
Verbose = $true
}
Invoke-WebRequest @Parameters
Start-Process -FilePath "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x64.exe" -ArgumentList "/install /passive /norestart" -Wait
Start-Process -FilePath "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x64.exe" -ArgumentList "/install /passive /norestart" -Wait
<#
PowerShell 5.1 (7.2 too) interprets the 8.3 file name literally, if an environment variable contains a non-latin word,
so you won't be able to remove "$env:TEMP\Microsoft_Windows_Desktop_Runtime*.log" file explicitly
<#
PowerShell 5.1 (7.2 too) interprets the 8.3 file name literally, if an environment variable contains a non-latin word,
so you won't be able to remove "$env:TEMP\Microsoft_Windows_Desktop_Runtime*.log" file explicitly
Another ways to get normal path to %TEMP%
[Environment]::GetEnvironmentVariable("TEMP", "User")
(Get-ItemProperty -Path HKCU:\Environment -Name TEMP).TEMP
[System.IO.Path]::GetTempPath()
#>
Get-ChildItem -Path "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x86.exe", "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x64.exe", "$env:TEMP\Microsoft_.NET_Runtime_*.log" -Force | Remove-Item -Recurse -Force -ErrorAction Ignore
}
Another ways to get normal path to %TEMP%
[Environment]::GetEnvironmentVariable("TEMP", "User")
(Get-ItemProperty -Path HKCU:\Environment -Name TEMP).TEMP
[System.IO.Path]::GetTempPath()
#>
Get-ChildItem -Path "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x86.exe", "$DownloadsFolder\dotnet-runtime-$LatestRelease-win-x64.exe", "$env:TEMP\Microsoft_Windows_Desktop_Runtime*.log" -Force | Remove-Item -Recurse -Force -ErrorAction Ignore
}
catch [System.Net.WebException]
{
@ -10411,8 +10413,8 @@ function MultipleInvokeContext
#>
function UpdateLGPEPolicies
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose
Write-Information -MessageData "" -InformationAction Continue
# Local Machine policies paths to scan recursively
$LM_Paths = @(
@ -10439,7 +10441,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -10488,7 +10489,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -10512,6 +10512,19 @@ function UpdateLGPEPolicies
}
}
# Re-build GPT.ini if it doesn't exist
if (-not (Test-Path -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini))
{
Start-Process -FilePath gpedit.msc
Start-Sleep -Seconds 2
# Get mmc.exe's Id with its' argument (gpedit.msc) to close
$gpedit_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {
$_.Name -eq "mmc.exe"
} | Where-Object -FilterScript {$_.CommandLine -match "GPEDIT.MSC"}).Handle
Get-Process -Id $gpedit_Process_ID | Stop-Process -Force
}
Update-GptIniVersion -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini -PolicyType Machine, User
# Apply the new policy immediately

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.0
Date: 04.07.2022
Version: v5.13.1
Date: 05.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.0 | 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.1 | 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.0
Date: 04.07.2022
Version: v5.13.1
Date: 05.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.0 (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.1 (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.0'
ModuleVersion = '5.13.1'
GUID = 'aa0b47a7-1770-4b5d-8c9f-cc6c505bcc7a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

66
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.0
Date: 04.07.2022
Version: v5.13.1
Date: 05.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -216,7 +216,7 @@ function Checkings
)
if (($PendingActions | Test-Path) -contains $true)
{
Write-Warning -Message "`n$($Localization.RebootPending)"
Write-Warning -Message $Localization.RebootPending
exit
}
@ -244,7 +244,7 @@ function Checkings
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/sophia_script_versions.json"
UseBasicParsing = $true
}
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_5_1
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerShell_7
$CurrentRelease = (Get-Module -Name Sophia).Version.ToString()
switch ([System.Version]$LatestRelease -gt [System.Version]$CurrentRelease)
{
@ -499,11 +499,19 @@ function DiagnosticDataLevel
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")})
{
# Security level
if (-not (Test-Path -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection))
{
New-Item -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Force
}
New-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 0 -Force
}
else
{
# Required diagnostic data
if (-not (Test-Path -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection))
{
New-Item -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Force
}
New-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 1 -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 1 -Force
@ -5700,6 +5708,11 @@ function NetworkAdaptersSavePower
$Enable
)
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
}
$Adapters = Get-NetAdapter -Physical | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
switch ($PSCmdlet.ParameterSetName)
@ -5722,14 +5735,17 @@ function NetworkAdaptersSavePower
}
}
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up.
# Otherwise functions below will indicate that there is not the Internet connection.
while
(
Get-NetAdapter -Physical | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up
# Otherwise functions below will indicate that there is no the Internet connection
if ($PhysicalAdaptersStatusUp)
{
Start-Sleep -Milliseconds 100
while
(
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
{
Start-Sleep -Seconds 2
}
}
}
@ -8498,10 +8514,10 @@ function InstallDotNetRuntime6
{
# https://github.com/dotnet/core/blob/main/release-notes/releases-index.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json"
UseBasicParsing = $true
Uri = "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/6.0/releases.json"
UseBasicParsing = $true
}
$LatestRelease = ((Invoke-RestMethod @Parameters)."releases-index" | Where-Object -FilterScript {$_."channel-version" -eq "6.0"})."latest-release"
$LatestRelease = (Invoke-RestMethod @Parameters)."latest-release"
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
# .NET Desktop Runtime x86
@ -9249,6 +9265,7 @@ function UninstallUWPApps
# Photos (and Video Editor)
"Microsoft.Windows.Photos",
"Microsoft.Photos.MediaEngineDLC",
"Microsoft.RawImageExtension"
# Calculator
"Microsoft.WindowsCalculator",
@ -9416,7 +9433,7 @@ function UninstallUWPApps
Write-Verbose -Message $Localization.Patient -Verbose
$AppxPackages = Get-AppxPackage -PackageTypeFilter Bundle -AllUsers:$AllUsers | Where-Object -FilterScript {$_.Name -notin $ExcludedAppxPackages}
$PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages().AdditionalTypeData[[Collections.IEnumerable].TypeHandle] | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
$PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
foreach ($AppxPackage in $AppxPackages)
{
@ -9767,7 +9784,7 @@ function RestoreUWPApps
# You cannot retrieve packages using -PackageTypeFilter Bundle, otherwise you won't get the InstallLocation attribute. It can be retrieved only by comparing with $Bundles
$Bundles = (Get-AppXPackage -PackageTypeFilter Bundle -AllUsers).Name
$AppxPackages = Get-AppxPackage -AllUsers | Where-Object -FilterScript {$_.PackageUserInformation -match "Staged"} | Where-Object -FilterScript {$_.Name -in $Bundles}
$PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages().AdditionalTypeData[[Collections.IEnumerable].TypeHandle] | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
$PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
foreach ($AppxPackage in $AppxPackages)
{
@ -12853,8 +12870,8 @@ function UseStoreOpenWith
#>
function UpdateLGPEPolicies
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose
Write-Information -MessageData "" -InformationAction Continue
# Local Machine policies paths to scan recursively
$LM_Paths = @(
@ -12881,7 +12898,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -12930,7 +12946,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -12954,6 +12969,19 @@ function UpdateLGPEPolicies
}
}
# Re-build GPT.ini if it doesn't exist
if (-not (Test-Path -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini))
{
Start-Process -FilePath gpedit.msc
Start-Sleep -Seconds 2
# Get mmc.exe's Id with its' argument (gpedit.msc) to close
$gpedit_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {
$_.Name -eq "mmc.exe"
} | Where-Object -FilterScript {$_.CommandLine -match "GPEDIT.MSC"}).Handle
Get-Process -Id $gpedit_Process_ID | Stop-Process -Force
}
Update-GptIniVersion -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini -PolicyType Machine, User
# Apply the new policy immediately

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.0
Date: 04.07.2022
Version: v5.13.1
Date: 05.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.0 (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.1 (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

BIN
Sophia Script/Sophia Script for Windows 10 PowerShell 7/bin/Microsoft.Windows.SDK.NET.dll

Binary file not shown.

BIN
Sophia Script/Sophia Script for Windows 10 PowerShell 7/bin/WinRT.Runtime.dll

Binary file not shown.

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.0
Date: 04.07.2022
Version: v5.13.1
Date: 05.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.0 | 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.1 | 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.0'
ModuleVersion = '5.13.1'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

60
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.0
Date: 04.07.2022
Version: v5.13.1
Date: 05.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -494,14 +494,22 @@ function DiagnosticDataLevel
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")})
{
# Security level
if (-not (Test-Path -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection))
{
New-Item -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Force
}
New-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 0 -Force
}
else
{
# Required diagnostic data
if (-not (Test-Path -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection))
{
New-Item -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Force
}
New-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 1 -Force
}
New-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 1 -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Diagnostics\DiagTrack -Name ShowedToastAtLevel -PropertyType DWord -Value 1 -Force
}
@ -5679,6 +5687,11 @@ function NetworkAdaptersSavePower
$Enable
)
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
}
$Adapters = Get-NetAdapter -Physical | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
switch ($PSCmdlet.ParameterSetName)
@ -5701,14 +5714,17 @@ function NetworkAdaptersSavePower
}
}
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up.
# Otherwise functions below will indicate that there is not the Internet connection.
while
(
Get-NetAdapter -Physical | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up
# Otherwise functions below will indicate that there is no the Internet connection
if ($PhysicalAdaptersStatusUp)
{
Start-Sleep -Milliseconds 100
while
(
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
{
Start-Sleep -Seconds 2
}
}
}
@ -8477,10 +8493,10 @@ function InstallDotNetRuntime6
{
# https://github.com/dotnet/core/blob/main/release-notes/releases-index.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json"
UseBasicParsing = $true
Uri = "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/6.0/releases.json"
UseBasicParsing = $true
}
$LatestRelease = ((Invoke-RestMethod @Parameters)."releases-index" | Where-Object -FilterScript {$_."channel-version" -eq "6.0"})."latest-release"
$LatestRelease = (Invoke-RestMethod @Parameters)."latest-release"
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
# .NET Desktop Runtime x86
@ -9218,6 +9234,7 @@ function UninstallUWPApps
# Photos (and Video Editor)
"Microsoft.Windows.Photos",
"Microsoft.Photos.MediaEngineDLC",
"Microsoft.RawImageExtension"
# Calculator
"Microsoft.WindowsCalculator",
@ -12805,8 +12822,8 @@ function UseStoreOpenWith
#>
function UpdateLGPEPolicies
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose
Write-Information -MessageData "" -InformationAction Continue
# Local Machine policies paths to scan recursively
$LM_Paths = @(
@ -12833,7 +12850,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -12882,7 +12898,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -12906,6 +12921,19 @@ function UpdateLGPEPolicies
}
}
# Re-build GPT.ini if it doesn't exist
if (-not (Test-Path -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini))
{
Start-Process -FilePath gpedit.msc
Start-Sleep -Seconds 2
# Get mmc.exe's Id with its' argument (gpedit.msc) to close
$gpedit_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {
$_.Name -eq "mmc.exe"
} | Where-Object -FilterScript {$_.CommandLine -match "GPEDIT.MSC"}).Handle
Get-Process -Id $gpedit_Process_ID | Stop-Process -Force
}
Update-GptIniVersion -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini -PolicyType Machine, User
# Apply the new policy immediately

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.0
Date: 04.07.2022
Version: v5.13.1
Date: 05.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.0 | 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.1 | 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.0
Date: 04.07.2022
Version: v6.1.1
Date: 05.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.0 | 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.1 | 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.0'
ModuleVersion = '6.1.1'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

64
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.0
Date: 04.07.2022
Version: v6.1.1
Date: 05.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -237,7 +237,7 @@ function Checkings
Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/sophia_script_versions.json"
UseBasicParsing = $true
}
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1
$LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_7
$CurrentRelease = (Get-Module -Name Sophia).Version.ToString()
switch ([System.Version]$LatestRelease -gt [System.Version]$CurrentRelease)
{
@ -492,11 +492,19 @@ function DiagnosticDataLevel
if (Get-WindowsEdition -Online | Where-Object -FilterScript {($_.Edition -like "Enterprise*") -or ($_.Edition -eq "Education")})
{
# Diagnostic data off
if (-not (Test-Path -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection))
{
New-Item -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Force
}
New-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 0 -Force
}
else
{
# Send required diagnostic data
if (-not (Test-Path -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection))
{
New-Item -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Force
}
New-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -PropertyType DWord -Value 1 -Force
}
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 1 -Force
@ -5256,6 +5264,11 @@ function NetworkAdaptersSavePower
$Enable
)
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
}
$Adapters = Get-NetAdapter -Physical | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
switch ($PSCmdlet.ParameterSetName)
@ -5278,14 +5291,17 @@ function NetworkAdaptersSavePower
}
}
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up.
# Otherwise functions below will indicate that there is not the Internet connection.
while
(
Get-NetAdapter -Physical | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up
# Otherwise functions below will indicate that there is no the Internet connection
if ($PhysicalAdaptersStatusUp)
{
Start-Sleep -Milliseconds 100
while
(
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
{
Start-Sleep -Seconds 2
}
}
}
@ -8090,10 +8106,10 @@ function InstallDotNetRuntime6
{
# https://github.com/dotnet/core/blob/main/release-notes/releases-index.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json"
UseBasicParsing = $true
Uri = "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/6.0/releases.json"
UseBasicParsing = $true
}
$LatestRelease = ((Invoke-RestMethod @Parameters)."releases-index" | Where-Object -FilterScript {$_."channel-version" -eq "6.0"})."latest-release"
$LatestRelease = (Invoke-RestMethod @Parameters)."latest-release"
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
# .NET Desktop Runtime x86
@ -8561,6 +8577,7 @@ function UninstallUWPApps
# Photos (and Video Editor)
"Microsoft.Windows.Photos",
"Microsoft.Photos.MediaEngineDLC",
"Microsoft.RawImageExtension"
# HEVC Video Extensions from Device Manufacturer
"Microsoft.HEVCVideoExtension",
@ -8752,7 +8769,7 @@ function UninstallUWPApps
$AppxPackages += Get-AppxPackage -Name SpotifyAB.SpotifyMusic -AllUsers:$AllUsers | Select-Object -Index 0
}
$PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages().AdditionalTypeData[[Collections.IEnumerable].TypeHandle] | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
$PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
foreach ($AppxPackage in $AppxPackages)
{
@ -9118,7 +9135,7 @@ function RestoreUWPApps
$AppxPackages += Get-AppxPackage -Name SpotifyAB.SpotifyMusic -AllUsers | Where-Object -FilterScript {$_.PackageUserInformation -match "Staged"} | Select-Object -Index 0
}
$PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages().AdditionalTypeData[[Collections.IEnumerable].TypeHandle] | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
$PackagesIds = [Windows.Management.Deployment.PackageManager]::new().FindPackages() | Select-Object -Property DisplayName -ExpandProperty Id | Select-Object -Property Name, DisplayName
foreach ($AppxPackage in $AppxPackages)
{
@ -12143,8 +12160,8 @@ function Windows10ContextMenu
#>
function UpdateLGPEPolicies
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose
Write-Information -MessageData "" -InformationAction Continue
# Local Machine policies paths to scan recursively
$LM_Paths = @(
@ -12171,7 +12188,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -12220,7 +12236,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -12244,6 +12259,19 @@ function UpdateLGPEPolicies
}
}
# Re-build GPT.ini if it doesn't exist
if (-not (Test-Path -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini))
{
Start-Process -FilePath gpedit.msc
Start-Sleep -Seconds 2
# Get mmc.exe's Id with its' argument (gpedit.msc) to close
$gpedit_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {
$_.Name -eq "mmc.exe"
} | Where-Object -FilterScript {$_.CommandLine -match "GPEDIT.MSC"}).Handle
Get-Process -Id $gpedit_Process_ID | Stop-Process -Force
}
Update-GptIniVersion -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini -PolicyType Machine, User
# Apply the new policy immediately

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

File diff suppressed because it is too large

BIN
Sophia Script/Sophia Script for Windows 11 PowerShell 7/bin/Microsoft.Windows.SDK.NET.dll

Binary file not shown.

BIN
Sophia Script/Sophia Script for Windows 11 PowerShell 7/bin/Start_Layout/start.bin

Binary file not shown.

BIN
Sophia Script/Sophia Script for Windows 11 PowerShell 7/bin/WinRT.Runtime.dll

Binary file not shown.

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.0
Date: 04.07.2022
Version: v6.1.1
Date: 05.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.0 | 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.1 | 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.0'
ModuleVersion = '6.1.1'
GUID = '109cc881-c42b-45af-a74a-550781989d6a'
Author = 'Dmitry "farag" Nefedov'
Copyright = '(c) 2014—2022 farag & Inestic. All rights reserved'

51
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.0
Date: 04.07.2022
Version: v6.1.1
Date: 05.07.2022
Copyright (c) 20142022 farag
Copyright (c) 20192022 farag & Inestic
@ -508,6 +508,7 @@ function DiagnosticDataLevel
}
"Default"
{
# Optional diagnostic data
Remove-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\DataCollection -Name AllowTelemetry -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection -Name MaxTelemetryAllowed -PropertyType DWord -Value 3 -Force
@ -5242,6 +5243,11 @@ function NetworkAdaptersSavePower
$Enable
)
if (Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"})
{
$PhysicalAdaptersStatusUp = @((Get-NetAdapter -Physical | Where-Object -FilterScript {$_.Status -eq "Up"}).Name)
}
$Adapters = Get-NetAdapter -Physical | Get-NetAdapterPowerManagement | Where-Object -FilterScript {$_.AllowComputerToTurnOffDevice -ne "Unsupported"}
switch ($PSCmdlet.ParameterSetName)
@ -5264,14 +5270,17 @@ function NetworkAdaptersSavePower
}
}
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up.
# Otherwise functions below will indicate that there is not the Internet connection.
while
(
Get-NetAdapter -Physical | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
# All network adapters are turned into "Disconnected" for few seconds, so we need to wait a bit to let them up
# Otherwise functions below will indicate that there is no the Internet connection
if ($PhysicalAdaptersStatusUp)
{
Start-Sleep -Milliseconds 100
while
(
Get-NetAdapter -Physical -Name $PhysicalAdaptersStatusUp | ForEach-Object -Process {$_.Status -eq "Disconnected"}
)
{
Start-Sleep -Seconds 2
}
}
}
@ -8076,10 +8085,10 @@ function InstallDotNetRuntime6
{
# https://github.com/dotnet/core/blob/main/release-notes/releases-index.json
$Parameters = @{
Uri = "https://raw.githubusercontent.com/dotnet/core/main/release-notes/releases-index.json"
UseBasicParsing = $true
Uri = "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/6.0/releases.json"
UseBasicParsing = $true
}
$LatestRelease = ((Invoke-RestMethod @Parameters)."releases-index" | Where-Object -FilterScript {$_."channel-version" -eq "6.0"})."latest-release"
$LatestRelease = (Invoke-RestMethod @Parameters)."latest-release"
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
# .NET Desktop Runtime x86
@ -8537,6 +8546,7 @@ function UninstallUWPApps
# Photos (and Video Editor)
"Microsoft.Windows.Photos",
"Microsoft.Photos.MediaEngineDLC",
"Microsoft.RawImageExtension"
# HEVC Video Extensions from Device Manufacturer
"Microsoft.HEVCVideoExtension",
@ -12104,8 +12114,8 @@ function Windows10ContextMenu
#>
function UpdateLGPEPolicies
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Localization.Patient -Verbose
Write-Information -MessageData "" -InformationAction Continue
# Local Machine policies paths to scan recursively
$LM_Paths = @(
@ -12132,7 +12142,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -12181,7 +12190,6 @@ function UpdateLGPEPolicies
{
try
{
Write-Information -MessageData "" -InformationAction Continue
Write-Verbose -Message $Item.Replace("{}", "") -Verbose
$Parameters = @{
@ -12205,6 +12213,19 @@ function UpdateLGPEPolicies
}
}
# Re-build GPT.ini if it doesn't exist
if (-not (Test-Path -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini))
{
Start-Process -FilePath gpedit.msc
Start-Sleep -Seconds 2
# Get mmc.exe's Id with its' argument (gpedit.msc) to close
$gpedit_Process_ID = (Get-CimInstance -ClassName CIM_Process | Where-Object -FilterScript {
$_.Name -eq "mmc.exe"
} | Where-Object -FilterScript {$_.CommandLine -match "GPEDIT.MSC"}).Handle
Get-Process -Id $gpedit_Process_ID | Stop-Process -Force
}
Update-GptIniVersion -Path $env:SystemRoot\System32\GroupPolicy\GPT.ini -PolicyType Machine, User
# Apply the new policy immediately

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.0
Date: 04.07.2022
Version: v6.1.1
Date: 05.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.0 | 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.1 | 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
Sophia Script/Sophia Script for Windows 11/bin/Start_Layout/start.bin

Binary file not shown.

2
Wrapper/Config/config_Windows_10.json

@ -2466,7 +2466,7 @@
"Tag": ""
}
},
"Preset": "",
"Preset": "Zero",
"WindowsDefault": ""
}
]

2
Wrapper/Config/config_Windows_10_LTSC.json

@ -2742,7 +2742,7 @@
"Tag": ""
}
},
"Preset": "",
"Preset": "Zero",
"WindowsDefault": "",
"LTSC2019": "true",
"LTSC2021": "true"

2
Wrapper/Config/config_Windows_11.json

@ -2306,7 +2306,7 @@
"Tag": ""
}
},
"Preset": "",
"Preset": "Zero",
"WindowsDefault": ""
}
]

2207
Wrapper/Localizations/it-IT/tooltip_Windows_10.json

File diff suppressed because it is too large

1992
Wrapper/Localizations/it-IT/tooltip_Windows_11.json

File diff suppressed because it is too large

70
Wrapper/Localizations/it-IT/ui.json

@ -1,70 +0,0 @@
[
{
"Id": "Menu",
"Options": {
"menuImportExportPreset": "Importa | Esporta",
"menuImportPreset": "Importa Preset",
"menuExportPreset": "Esporta Preset",
"menuPresets": "Preset",
"menuOpposite": "Inverti inpostazioni",
"menuClear": "Reimposta",
"menuTheme": "Tema",
"menuThemeDark": "Scuro",
"menuThemeLight": "Chiaro",
"menuLanguage": "Lingua",
"menuAbout": "Informazioni"
}
},
{
"Id": "Tab",
"Options": {
"tabSystemProtection": "Protezione del sistema",
"tabPrivacyTelemetry": "Privacy & Telemetria",
"tabUIPersonalization": "Interfaccia & Personalizzazione",
"tabOneDrive": "OneDrive",
"tabSystem": "Sistema",
"tabWSL": "WSL",
"tabStartMenu": "Menu Start",
"tabUWP": "App UWP",
"tabGaming": "Gaming",
"tabScheduledTasks": "Operazioni pianificate",
"tabDefenderSecurity": "Windows Defender & Sicurezza",
"tabContextMenu": "Menu contestuale",
"tabConsoleOutput": "Output della console"
}
},
{
"Id": "Button",
"Options": {
"btnRefreshConsole": "Riarica la console",
"btnRunPowerShell": "Esegui PowerShell"
}
},
{
"Id": "StatusBar",
"Options": {
"statusBarHover": "Passa il cursore del mouse sugli elemento selezionatozione per mostrare informazioni su esso",
"statusBarPresetLoaded": "preset caricato!",
"statusBarPresetNotComp": "il file preset file non è compatibile!",
"statusBarSophiaPreset": "Sophia preset caricato!",
"statusBarWindowsDefaultPreset": "Preset di Windows predefinito caricato!",
"statusBarPowerShellScriptCreatedFromSelections": "Script PowerShell creato in base alle tue selezioni!Ora puoi eseguirlo o salvarlo.",
"statusBarPowerShellExport": "Script PowerShell creato!",
"statusBarOpposite": "Le opzioni selezionate sono state invertite!",
"statusBarClear": "Le opzioni selezionate sono state annullate",
"statusBarDisabled": "Devi 'Importare un preset' per l'uso di Wrapper. Importalo per abilitare le opzioni.",
"statusBarCurrentOS": "Current OS"
}
},
{
"Id": "MessageBox",
"Options": {
"messageBoxNewWrapperFound": "Una nuova versione di 'Wrapper' è stata trovata.\n Aprire la pagina pagina dei rilasci di GitHub?",
"messageBoxNewSophiaFound": "Una nuova versione di 'Sophi Script' è stata trovata.\n Aprire la pagina pagina dei rilasci di GitHub?",
"messageBoxDoesNotExist": "Non esiste",
"messageBoxPresetNotComp": "Il file preset non è compatibile! ",
"messageBoxFilesMissingClose": "Mancano alcuni file. Il wrapper si chiuderà",
"messageBoxConsoleEmpty": "La console è vuota.\n Fare clic sul pulsante 'Aggiorna console' per creare lo script con le selezioni"
}
}
]

BIN
Wrapper/SophiaScriptWrapper.exe

Binary file not shown.
Loading…
Cancel
Save