From 57863528d9bc5c180a24f8c8c9c38e864336fcb7 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Sat, 7 Feb 2026 14:19:22 +0300 Subject: [PATCH] Removed LatestInstalled.NET --- .github/workflows/PSSCriptAnalyzer.yml | 18 ++++++- .github/workflows/Sophia.yml | 18 ++++++- Wrapper/Config/config_Windows_10.json | 16 ------ Wrapper/Config/config_Windows_10_LTSC.json | 18 ------- Wrapper/Config/config_Windows_11.json | 16 ------ Wrapper/Config/config_Windows_11_ARM.json | 16 ------ Wrapper/Config/config_Windows_11_LTSC.json | 17 ------ .../de-DE/tooltip_Windows_10.json | 14 ----- .../de-DE/tooltip_Windows_11.json | 14 ----- .../de-DE/tooltip_Windows_11_ARM.json | 14 ----- .../en-US/tooltip_Windows_10.json | 14 ----- .../en-US/tooltip_Windows_11.json | 16 +----- .../en-US/tooltip_Windows_11_ARM.json | 14 ----- .../ru-RU/tooltip_Windows_10.json | 14 ----- .../ru-RU/tooltip_Windows_11.json | 14 ----- .../ru-RU/tooltip_Windows_11_ARM.json | 14 ----- .../Module/Sophia.psm1 | 52 ------------------- src/Sophia_Script_for_Windows_10/Sophia.ps1 | 10 +--- .../Module/Sophia.psm1 | 52 ------------------- .../Sophia.ps1 | 8 --- .../Module/Sophia.psm1 | 52 ------------------- .../Sophia.ps1 | 8 --- .../Module/Sophia.psm1 | 52 ------------------- .../Sophia.ps1 | 8 --- .../Module/Private/InitialActions.ps1 | 3 ++ .../Module/Sophia.psm1 | 52 ------------------- src/Sophia_Script_for_Windows_11/Sophia.ps1 | 8 --- .../Module/Sophia.psm1 | 52 ------------------- .../Sophia.ps1 | 8 --- .../Module/Sophia.psm1 | 52 ------------------- .../Sophia.ps1 | 8 --- .../Module/Sophia.psm1 | 52 ------------------- .../Sophia.ps1 | 8 --- .../Module/Sophia.psm1 | 52 ------------------- .../Sophia.ps1 | 8 --- 35 files changed, 39 insertions(+), 753 deletions(-) diff --git a/.github/workflows/PSSCriptAnalyzer.yml b/.github/workflows/PSSCriptAnalyzer.yml index 49e6adc5..80b01664 100644 --- a/.github/workflows/PSSCriptAnalyzer.yml +++ b/.github/workflows/PSSCriptAnalyzer.yml @@ -15,10 +15,11 @@ jobs: - name: Run PSScriptAnalyzer run: | + # Check module for errors $Results = @(Get-ChildItem -Path src -File -Recurse -Include *.ps1, *.psm1, *.psd1 | Invoke-ScriptAnalyzer) if ($Results | Where-Object -FilterScript {($_.Severity -eq "Error") -or ($_.Severity -eq "ParseError")}) { - Write-Verbose -Message "Found script issues" -Verbose + Write-Verbose -Message "Found script issue" -Verbose $Results | Where-Object -FilterScript {($_.Severity -eq "Error") -or ($_.Severity -eq "ParseError")} | ForEach-Object -Process { [PSCustomObject]@{ @@ -30,3 +31,18 @@ jobs: exit 1 # Exit with a non-zero status to fail the job } + + - name: Check JSONs validity + run: | + # Check JSONs for errors + $JSONs = [Array]::TrueForAll((@(Get-ChildItem -Path Wrapper -File -Recurse -Filter *.json).FullName), + [Predicate[string]]{ + param($JSON) + + Test-Json -Path $JSON -ErrorAction Ignore + }) + if (-not $JSONs) + { + Write-Verbose -Message "Found JSON issue" -Verbose + exit 1 # Exit with a non-zero status to fail the job + } diff --git a/.github/workflows/Sophia.yml b/.github/workflows/Sophia.yml index ed56c706..1acbdab0 100644 --- a/.github/workflows/Sophia.yml +++ b/.github/workflows/Sophia.yml @@ -17,10 +17,11 @@ jobs: - name: Run PSScriptAnalyzer run: | + # Check module for errors $Results = @(Get-ChildItem -Path src -File -Recurse -Include *.ps1, *.psm1, *.psd1 | Invoke-ScriptAnalyzer) if ($Results | Where-Object -FilterScript {($_.Severity -eq "Error") -or ($_.Severity -eq "ParseError")}) { - Write-Verbose -Message "Found script issues" -Verbose + Write-Verbose -Message "Found script issue" -Verbose $Results | Where-Object -FilterScript {($_.Severity -eq "Error") -or ($_.Severity -eq "ParseError")} | ForEach-Object -Process { [PSCustomObject]@{ @@ -33,6 +34,21 @@ jobs: exit 1 # Exit with a non-zero status to fail the job } + - name: Check JSONs validity + run: | + # Check JSONs for errors + $JSONs = [Array]::TrueForAll((@(Get-ChildItem -Path Wrapper -File -Recurse -Filter *.json).FullName), + [Predicate[string]]{ + param($JSON) + + Test-Json -Path $JSON -ErrorAction Ignore + }) + if (-not $JSONs) + { + Write-Verbose -Message "Found JSON issue" -Verbose + exit 1 # Exit with a non-zero status to fail the job + } + - name: Download Dependencies run: | . "Scripts\Dependencies.ps1" diff --git a/Wrapper/Config/config_Windows_10.json b/Wrapper/Config/config_Windows_10.json index 15c5d566..2d1d104c 100644 --- a/Wrapper/Config/config_Windows_10.json +++ b/Wrapper/Config/config_Windows_10.json @@ -1419,22 +1419,6 @@ "Preset": "Zero", "WindowsDefault": "Two" }, - { - "Region": "System", - "Control": "cmb", - "Required": "false", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable" - }, - "One": { - "Tag": "Disable" - } - }, - "Preset": "Zero", - "WindowsDefault": "One" - }, { "Region": "System", "Control": "cmb", diff --git a/Wrapper/Config/config_Windows_10_LTSC.json b/Wrapper/Config/config_Windows_10_LTSC.json index 1464a938..fe8b169b 100644 --- a/Wrapper/Config/config_Windows_10_LTSC.json +++ b/Wrapper/Config/config_Windows_10_LTSC.json @@ -1433,24 +1433,6 @@ "LTSC2019": "true", "LTSC2021": "true" }, - { - "Region": "System", - "Control": "cmb", - "Required": "false", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable" - }, - "One": { - "Tag": "Disable" - } - }, - "Preset": "Zero", - "WindowsDefault": "One", - "LTSC2019": "true", - "LTSC2021": "true" - }, { "Region": "System", "Control": "cmb", diff --git a/Wrapper/Config/config_Windows_11.json b/Wrapper/Config/config_Windows_11.json index e32020cb..50dfe401 100644 --- a/Wrapper/Config/config_Windows_11.json +++ b/Wrapper/Config/config_Windows_11.json @@ -1284,22 +1284,6 @@ "Preset": "Zero", "WindowsDefault": "Two" }, - { - "Region": "System", - "Control": "cmb", - "Required": "false", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable" - }, - "One": { - "Tag": "Disable" - } - }, - "Preset": "Zero", - "WindowsDefault": "One" - }, { "Region": "System", "Control": "cmb", diff --git a/Wrapper/Config/config_Windows_11_ARM.json b/Wrapper/Config/config_Windows_11_ARM.json index 7fc6966c..29708570 100644 --- a/Wrapper/Config/config_Windows_11_ARM.json +++ b/Wrapper/Config/config_Windows_11_ARM.json @@ -1268,22 +1268,6 @@ "Preset": "Zero", "WindowsDefault": "Two" }, - { - "Region": "System", - "Control": "cmb", - "Required": "false", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable" - }, - "One": { - "Tag": "Disable" - } - }, - "Preset": "Zero", - "WindowsDefault": "One" - }, { "Region": "System", "Control": "cmb", diff --git a/Wrapper/Config/config_Windows_11_LTSC.json b/Wrapper/Config/config_Windows_11_LTSC.json index 9af8558a..d56932eb 100644 --- a/Wrapper/Config/config_Windows_11_LTSC.json +++ b/Wrapper/Config/config_Windows_11_LTSC.json @@ -1308,23 +1308,6 @@ "WindowsDefault": "Two", "LTSC2024": "true" }, - { - "Region": "System", - "Control": "cmb", - "Required": "false", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable" - }, - "One": { - "Tag": "Disable" - } - }, - "Preset": "Zero", - "WindowsDefault": "One", - "LTSC2024": "true" - }, { "Region": "System", "Control": "cmb", diff --git a/Wrapper/Localizations/de-DE/tooltip_Windows_10.json b/Wrapper/Localizations/de-DE/tooltip_Windows_10.json index 1af454df..41582b89 100644 --- a/Wrapper/Localizations/de-DE/tooltip_Windows_10.json +++ b/Wrapper/Localizations/de-DE/tooltip_Windows_10.json @@ -1171,20 +1171,6 @@ } } }, - { - "Region": "System", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable", - "ToolTip": "Verwenden Sie die neueste installierte .NET-Laufzeitumgebung für alle Anwendungen." - }, - "One": { - "Tag": "Disable", - "ToolTip": "Die zuletzt installierte .NET-Laufzeitumgebung nicht für alle Anwendungen verwenden (Standardwert)." - } - } - }, { "Region": "System", "Function": "WinPrtScrFolder", diff --git a/Wrapper/Localizations/de-DE/tooltip_Windows_11.json b/Wrapper/Localizations/de-DE/tooltip_Windows_11.json index 8af90e15..7b6855f7 100644 --- a/Wrapper/Localizations/de-DE/tooltip_Windows_11.json +++ b/Wrapper/Localizations/de-DE/tooltip_Windows_11.json @@ -1126,20 +1126,6 @@ } } }, - { - "Region": "System", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable", - "ToolTip": "Verwenden Sie die neueste installierte .NET-Laufzeitumgebung für alle Anwendungen." - }, - "One": { - "Tag": "Disable", - "ToolTip": "Die zuletzt installierte .NET-Laufzeitumgebung nicht für alle Anwendungen verwenden (Standardwert)." - } - } - }, { "Region": "System", "Function": "WinPrtScrFolder", diff --git a/Wrapper/Localizations/de-DE/tooltip_Windows_11_ARM.json b/Wrapper/Localizations/de-DE/tooltip_Windows_11_ARM.json index 9eeaf6b0..8ed69edb 100644 --- a/Wrapper/Localizations/de-DE/tooltip_Windows_11_ARM.json +++ b/Wrapper/Localizations/de-DE/tooltip_Windows_11_ARM.json @@ -1107,20 +1107,6 @@ } } }, - { - "Region": "System", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable", - "ToolTip": "Verwenden Sie die neueste installierte .NET-Laufzeitumgebung für alle Anwendungen." - }, - "One": { - "Tag": "Disable", - "ToolTip": "Die zuletzt installierte .NET-Laufzeitumgebung nicht für alle Anwendungen verwenden (Standardwert)." - } - } - }, { "Region": "System", "Function": "WinPrtScrFolder", diff --git a/Wrapper/Localizations/en-US/tooltip_Windows_10.json b/Wrapper/Localizations/en-US/tooltip_Windows_10.json index 44f30058..61d21057 100644 --- a/Wrapper/Localizations/en-US/tooltip_Windows_10.json +++ b/Wrapper/Localizations/en-US/tooltip_Windows_10.json @@ -1171,20 +1171,6 @@ } } }, - { - "Region": "System", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable", - "ToolTip": "Use .NET Framework 4.8.1 for old apps." - }, - "One": { - "Tag": "Disable", - "ToolTip": "Do not use .NET Framework 4.8.1 for old apps (default value)." - } - } - }, { "Region": "System", "Function": "WinPrtScrFolder", diff --git a/Wrapper/Localizations/en-US/tooltip_Windows_11.json b/Wrapper/Localizations/en-US/tooltip_Windows_11.json index 34a45d46..28887fa3 100644 --- a/Wrapper/Localizations/en-US/tooltip_Windows_11.json +++ b/Wrapper/Localizations/en-US/tooltip_Windows_11.json @@ -15,7 +15,7 @@ }, { "Region": "Protection", - "Function": "Logging", + "Function": "Logging" "Arg": { "Zero": { "Tag": "", @@ -1126,20 +1126,6 @@ } } }, - { - "Region": "System", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable", - "ToolTip": "Use .NET Framework 4.8.1 for old apps." - }, - "One": { - "Tag": "Disable", - "ToolTip": "Do not use .NET Framework 4.8.1 for old apps (default value)." - } - } - }, { "Region": "System", "Function": "WinPrtScrFolder", diff --git a/Wrapper/Localizations/en-US/tooltip_Windows_11_ARM.json b/Wrapper/Localizations/en-US/tooltip_Windows_11_ARM.json index 2fc22fac..aee99c8b 100644 --- a/Wrapper/Localizations/en-US/tooltip_Windows_11_ARM.json +++ b/Wrapper/Localizations/en-US/tooltip_Windows_11_ARM.json @@ -1107,20 +1107,6 @@ } } }, - { - "Region": "System", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable", - "ToolTip": "Use .NET Framework 4.8.1 for old apps." - }, - "One": { - "Tag": "Disable", - "ToolTip": "Do not use .NET Framework 4.8.1 for old apps (default value)." - } - } - }, { "Region": "System", "Function": "WinPrtScrFolder", diff --git a/Wrapper/Localizations/ru-RU/tooltip_Windows_10.json b/Wrapper/Localizations/ru-RU/tooltip_Windows_10.json index b9118cc6..a5ac420a 100644 --- a/Wrapper/Localizations/ru-RU/tooltip_Windows_10.json +++ b/Wrapper/Localizations/ru-RU/tooltip_Windows_10.json @@ -1171,20 +1171,6 @@ } } }, - { - "Region": "System", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable", - "ToolTip": "Использовать .NET Framework 4.8.1 для устаревших программ." - }, - "One": { - "Tag": "Disable", - "ToolTip": "Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию)." - } - } - }, { "Region": "System", "Function": "WinPrtScrFolder", diff --git a/Wrapper/Localizations/ru-RU/tooltip_Windows_11.json b/Wrapper/Localizations/ru-RU/tooltip_Windows_11.json index e1a19efa..61554eb1 100644 --- a/Wrapper/Localizations/ru-RU/tooltip_Windows_11.json +++ b/Wrapper/Localizations/ru-RU/tooltip_Windows_11.json @@ -1126,20 +1126,6 @@ } } }, - { - "Region": "System", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable", - "ToolTip": "Использовать .NET Framework 4.8.1 для устаревших программ." - }, - "One": { - "Tag": "Disable", - "ToolTip": "Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию)." - } - } - }, { "Region": "System", "Function": "WinPrtScrFolder", diff --git a/Wrapper/Localizations/ru-RU/tooltip_Windows_11_ARM.json b/Wrapper/Localizations/ru-RU/tooltip_Windows_11_ARM.json index 64a2edf5..0fc4700d 100644 --- a/Wrapper/Localizations/ru-RU/tooltip_Windows_11_ARM.json +++ b/Wrapper/Localizations/ru-RU/tooltip_Windows_11_ARM.json @@ -1107,20 +1107,6 @@ } } }, - { - "Region": "System", - "Function": "LatestInstalled.NET", - "Arg": { - "Zero": { - "Tag": "Enable", - "ToolTip": "Использовать .NET Framework 4.8.1 для устаревших программ." - }, - "One": { - "Tag": "Disable", - "ToolTip": "Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию)." - } - } - }, { "Region": "System", "Function": "WinPrtScrFolder", diff --git a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 index d061fb06..685a5100 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 @@ -6573,58 +6573,6 @@ function Set-UserShellFolderLocation } } -<# - .SYNOPSIS - The the latest installed .NET Desktop Runtime for all apps usage - - .PARAMETER Enable - Use .NET Framework 4.8.1 for old apps - - .PARAMETER Disable - Do not use .NET Framework 4.8.1 for old apps - - .EXAMPLE - LatestInstalled.NET -Enable - - .EXAMPLE - LatestInstalled.NET -Disable - - .NOTES - Machine-wide -#> -function LatestInstalled.NET -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - } - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore - } - } -} - <# .SYNOPSIS The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S diff --git a/src/Sophia_Script_for_Windows_10/Sophia.ps1 b/src/Sophia_Script_for_Windows_10/Sophia.ps1 index 128c7e21..bb3b6d62 100644 --- a/src/Sophia_Script_for_Windows_10/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_10/Sophia.ps1 @@ -767,7 +767,7 @@ InputMethod -English Пользовательские файлы и папки не будут перемещены в новое расположение. Переместите их вручную По умолчанию они располагаются в папке %USERPROFILE% #> -Set-UserShellFolderLocation -Root +Set-UserShellFolderLocation -Root ### <# Select folders for user folders location manually using a folder browser dialog @@ -791,14 +791,6 @@ Set-UserShellFolderLocation -Root #> # Set-UserShellFolderLocation -Default -# Use .NET Framework 4.8.1 for old apps -# Использовать .NET Framework 4.8.1 для устаревших программ -# LatestInstalled.NET -Enable - -# Do not use .NET Framework 4.8.1 for old apps (default value) -# Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию) -# LatestInstalled.NET -Disable - # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол WinPrtScrFolder -Desktop diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 index 46ca842a..0d50d367 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1 @@ -4968,58 +4968,6 @@ function Set-UserShellFolderLocation } } -<# - .SYNOPSIS - The the latest installed .NET Desktop Runtime for all apps usage - - .PARAMETER Enable - Use .NET Framework 4.8.1 for old apps - - .PARAMETER Disable - Do not use .NET Framework 4.8.1 for old apps - - .EXAMPLE - LatestInstalled.NET -Enable - - .EXAMPLE - LatestInstalled.NET -Disable - - .NOTES - Machine-wide -#> -function LatestInstalled.NET -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - } - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore - } - } -} - <# .SYNOPSIS The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 index fad3f903..c8553d8c 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 @@ -615,14 +615,6 @@ Set-UserShellFolderLocation -Root #> # Set-UserShellFolderLocation -Default -# Use .NET Framework 4.8.1 for old apps -# Использовать .NET Framework 4.8.1 для устаревших программ -# LatestInstalled.NET -Enable - -# Do not use .NET Framework 4.8.1 for old apps (default value) -# Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию) -# LatestInstalled.NET -Disable - # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол WinPrtScrFolder -Desktop diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 index 1ce5a0ad..27f3f2fb 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1 @@ -5785,58 +5785,6 @@ function Set-UserShellFolderLocation } } -<# - .SYNOPSIS - The the latest installed .NET Desktop Runtime for all apps usage - - .PARAMETER Enable - Use .NET Framework 4.8.1 for old apps - - .PARAMETER Disable - Do not use .NET Framework 4.8.1 for old apps - - .EXAMPLE - LatestInstalled.NET -Enable - - .EXAMPLE - LatestInstalled.NET -Disable - - .NOTES - Machine-wide -#> -function LatestInstalled.NET -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - } - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore - } - } -} - <# .SYNOPSIS The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1 index 27b5d5c2..3e7553d3 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1 @@ -712,14 +712,6 @@ Set-UserShellFolderLocation -Root #> # Set-UserShellFolderLocation -Default -# Use .NET Framework 4.8.1 for old apps -# Использовать .NET Framework 4.8.1 для устаревших программ -# LatestInstalled.NET -Enable - -# Do not use .NET Framework 4.8.1 for old apps (default value) -# Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию) -# LatestInstalled.NET -Disable - # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол WinPrtScrFolder -Desktop diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 index 022dad96..aeb00e91 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1 @@ -6575,58 +6575,6 @@ function Set-UserShellFolderLocation } } -<# - .SYNOPSIS - The the latest installed .NET Desktop Runtime for all apps usage - - .PARAMETER Enable - Use .NET Framework 4.8.1 for old apps - - .PARAMETER Disable - Do not use .NET Framework 4.8.1 for old apps - - .EXAMPLE - LatestInstalled.NET -Enable - - .EXAMPLE - LatestInstalled.NET -Disable - - .NOTES - Machine-wide -#> -function LatestInstalled.NET -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - } - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore - } - } -} - <# .SYNOPSIS The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1 index 3fc56203..a0a72472 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1 @@ -791,14 +791,6 @@ Set-UserShellFolderLocation -Root #> # Set-UserShellFolderLocation -Default -# Use .NET Framework 4.8.1 for old apps -# Использовать .NET Framework 4.8.1 для устаревших программ -# LatestInstalled.NET -Enable - -# Do not use .NET Framework 4.8.1 for old apps (default value) -# Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию) -# LatestInstalled.NET -Disable - # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол WinPrtScrFolder -Desktop diff --git a/src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1 index fead78b1..d3819690 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1 @@ -900,6 +900,9 @@ public extern static string BrandingFormatString(string sFormat); Get-CimInstance -ClassName CIM_ComputerSystem | Set-CimInstance -Property @{AutomaticManagedPageFile = $true} } + # If you do not use old applications, there's no need to force old applications based on legacy .NET Framework 2.0, 3.0, or 3.5 to use .NET Framework 4.8.1 ### + Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore + # PowerShell 5.1 (7.5 too) interprets 8.3 file name literally, if an environment variable contains a non-Latin word # https://github.com/PowerShell/PowerShell/issues/21070 Get-ChildItem -Path "$env:TEMP\LGPO.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index 12285162..968b8dba 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -5994,58 +5994,6 @@ function Set-UserShellFolderLocation } } -<# - .SYNOPSIS - The the latest installed .NET Desktop Runtime for all apps usage - - .PARAMETER Enable - Use .NET Framework 4.8.1 for old apps - - .PARAMETER Disable - Do not use .NET Framework 4.8.1 for old apps - - .EXAMPLE - LatestInstalled.NET -Enable - - .EXAMPLE - LatestInstalled.NET -Disable - - .NOTES - Machine-wide -#> -function LatestInstalled.NET -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - } - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore - } - } -} - <# .SYNOPSIS The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S diff --git a/src/Sophia_Script_for_Windows_11/Sophia.ps1 b/src/Sophia_Script_for_Windows_11/Sophia.ps1 index 8ebd49f8..7e7cf649 100644 --- a/src/Sophia_Script_for_Windows_11/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11/Sophia.ps1 @@ -765,14 +765,6 @@ Set-UserShellFolderLocation -Root #> # Set-UserShellFolderLocation -Default -# Use .NET Framework 4.8.1 for old apps -# Использовать .NET Framework 4.8.1 для устаревших программ -# LatestInstalled.NET -Enable - -# Do not use .NET Framework 4.8.1 for old apps (default value) -# Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию) -# LatestInstalled.NET -Disable - # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол WinPrtScrFolder -Desktop diff --git a/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 index 31fe8c1d..0eea8fd2 100644 --- a/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1 @@ -5925,58 +5925,6 @@ function Set-UserShellFolderLocation } } -<# - .SYNOPSIS - The the latest installed .NET Desktop Runtime for all apps usage - - .PARAMETER Enable - Use .NET Framework 4.8.1 for old apps - - .PARAMETER Disable - Do not use .NET Framework 4.8.1 for old apps - - .EXAMPLE - LatestInstalled.NET -Enable - - .EXAMPLE - LatestInstalled.NET -Disable - - .NOTES - Machine-wide -#> -function LatestInstalled.NET -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - } - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore - } - } -} - <# .SYNOPSIS The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S diff --git a/src/Sophia_Script_for_Windows_11_ARM/Sophia.ps1 b/src/Sophia_Script_for_Windows_11_ARM/Sophia.ps1 index 1482fcb8..3f300959 100644 --- a/src/Sophia_Script_for_Windows_11_ARM/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11_ARM/Sophia.ps1 @@ -761,14 +761,6 @@ Set-UserShellFolderLocation -Root #> # Set-UserShellFolderLocation -Default -# Use .NET Framework 4.8.1 for old apps -# Использовать .NET Framework 4.8.1 для устаревших программ -# LatestInstalled.NET -Enable - -# Do not use .NET Framework 4.8.1 for old apps (default value) -# Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию) -# LatestInstalled.NET -Disable - # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол WinPrtScrFolder -Desktop diff --git a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 index 0491f394..07f8cd5e 100644 --- a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1 @@ -5927,58 +5927,6 @@ function Set-UserShellFolderLocation } } -<# - .SYNOPSIS - The the latest installed .NET Desktop Runtime for all apps usage - - .PARAMETER Enable - Use .NET Framework 4.8.1 for old apps - - .PARAMETER Disable - Do not use .NET Framework 4.8.1 for old apps - - .EXAMPLE - LatestInstalled.NET -Enable - - .EXAMPLE - LatestInstalled.NET -Disable - - .NOTES - Machine-wide -#> -function LatestInstalled.NET -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - } - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore - } - } -} - <# .SYNOPSIS The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S diff --git a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Sophia.ps1 b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Sophia.ps1 index beda8b22..45a6c5d9 100644 --- a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Sophia.ps1 @@ -761,14 +761,6 @@ Set-UserShellFolderLocation -Root #> # Set-UserShellFolderLocation -Default -# Use .NET Framework 4.8.1 for old apps -# Использовать .NET Framework 4.8.1 для устаревших программ -# LatestInstalled.NET -Enable - -# Do not use .NET Framework 4.8.1 for old apps (default value) -# Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию) -# LatestInstalled.NET -Disable - # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол WinPrtScrFolder -Desktop diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 index aae54c3c..ee894f21 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1 @@ -5603,58 +5603,6 @@ function Set-UserShellFolderLocation } } -<# - .SYNOPSIS - The the latest installed .NET Desktop Runtime for all apps usage - - .PARAMETER Enable - Use .NET Framework 4.8.1 for old apps - - .PARAMETER Disable - Do not use .NET Framework 4.8.1 for old apps - - .EXAMPLE - LatestInstalled.NET -Enable - - .EXAMPLE - LatestInstalled.NET -Disable - - .NOTES - Machine-wide -#> -function LatestInstalled.NET -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - } - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore - } - } -} - <# .SYNOPSIS The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 index d2a0720b..66d520d6 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 @@ -739,14 +739,6 @@ Set-UserShellFolderLocation -Root #> # Set-UserShellFolderLocation -Default -# Use .NET Framework 4.8.1 for old apps -# Использовать .NET Framework 4.8.1 для устаревших программ -# LatestInstalled.NET -Enable - -# Do not use .NET Framework 4.8.1 for old apps (default value) -# Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию) -# LatestInstalled.NET -Disable - # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол WinPrtScrFolder -Desktop diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 index fb1fb490..1a0d7d0a 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1 @@ -5996,58 +5996,6 @@ function Set-UserShellFolderLocation } } -<# - .SYNOPSIS - The the latest installed .NET Desktop Runtime for all apps usage - - .PARAMETER Enable - Use .NET Framework 4.8.1 for old apps - - .PARAMETER Disable - Do not use .NET Framework 4.8.1 for old apps - - .EXAMPLE - LatestInstalled.NET -Enable - - .EXAMPLE - LatestInstalled.NET -Disable - - .NOTES - Machine-wide -#> -function LatestInstalled.NET -{ - param - ( - [Parameter( - Mandatory = $true, - ParameterSetName = "Enable" - )] - [switch] - $Enable, - - [Parameter( - Mandatory = $true, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - switch ($PSCmdlet.ParameterSetName) - { - "Enable" - { - New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - New-ItemProperty -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -PropertyType DWord -Value 1 -Force - } - "Disable" - { - Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\.NETFramework, HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework -Name OnlyUseLatestCLR -Force -ErrorAction Ignore - } - } -} - <# .SYNOPSIS The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S diff --git a/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 b/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 index df76627b..f2010d32 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 @@ -765,14 +765,6 @@ Set-UserShellFolderLocation -Root #> # Set-UserShellFolderLocation -Default -# Use .NET Framework 4.8.1 for old apps -# Использовать .NET Framework 4.8.1 для устаревших программ -# LatestInstalled.NET -Enable - -# Do not use .NET Framework 4.8.1 for old apps (default value) -# Не использовать .NET Framework 4.8.1 для устаревших программ (значение по умолчанию) -# LatestInstalled.NET -Disable - # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол WinPrtScrFolder -Desktop