Browse Source

Removed LatestInstalled.NET

pull/703/head
Dmitry Nefedov 2 months ago
parent
commit
57863528d9
  1. 18
      .github/workflows/PSSCriptAnalyzer.yml
  2. 18
      .github/workflows/Sophia.yml
  3. 16
      Wrapper/Config/config_Windows_10.json
  4. 18
      Wrapper/Config/config_Windows_10_LTSC.json
  5. 16
      Wrapper/Config/config_Windows_11.json
  6. 16
      Wrapper/Config/config_Windows_11_ARM.json
  7. 17
      Wrapper/Config/config_Windows_11_LTSC.json
  8. 14
      Wrapper/Localizations/de-DE/tooltip_Windows_10.json
  9. 14
      Wrapper/Localizations/de-DE/tooltip_Windows_11.json
  10. 14
      Wrapper/Localizations/de-DE/tooltip_Windows_11_ARM.json
  11. 14
      Wrapper/Localizations/en-US/tooltip_Windows_10.json
  12. 16
      Wrapper/Localizations/en-US/tooltip_Windows_11.json
  13. 14
      Wrapper/Localizations/en-US/tooltip_Windows_11_ARM.json
  14. 14
      Wrapper/Localizations/ru-RU/tooltip_Windows_10.json
  15. 14
      Wrapper/Localizations/ru-RU/tooltip_Windows_11.json
  16. 14
      Wrapper/Localizations/ru-RU/tooltip_Windows_11_ARM.json
  17. 52
      src/Sophia_Script_for_Windows_10/Module/Sophia.psm1
  18. 10
      src/Sophia_Script_for_Windows_10/Sophia.ps1
  19. 52
      src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Sophia.psm1
  20. 8
      src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1
  21. 52
      src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Sophia.psm1
  22. 8
      src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1
  23. 52
      src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1
  24. 8
      src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1
  25. 3
      src/Sophia_Script_for_Windows_11/Module/Private/InitialActions.ps1
  26. 52
      src/Sophia_Script_for_Windows_11/Module/Sophia.psm1
  27. 8
      src/Sophia_Script_for_Windows_11/Sophia.ps1
  28. 52
      src/Sophia_Script_for_Windows_11_ARM/Module/Sophia.psm1
  29. 8
      src/Sophia_Script_for_Windows_11_ARM/Sophia.ps1
  30. 52
      src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Module/Sophia.psm1
  31. 8
      src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Sophia.ps1
  32. 52
      src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Sophia.psm1
  33. 8
      src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1
  34. 52
      src/Sophia_Script_for_Windows_11_PowerShell_7/Module/Sophia.psm1
  35. 8
      src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

18
.github/workflows/PSSCriptAnalyzer.yml

@ -15,10 +15,11 @@ jobs:
- name: Run PSScriptAnalyzer - name: Run PSScriptAnalyzer
run: | run: |
# Check module for errors
$Results = @(Get-ChildItem -Path src -File -Recurse -Include *.ps1, *.psm1, *.psd1 | Invoke-ScriptAnalyzer) $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")}) 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 { $Results | Where-Object -FilterScript {($_.Severity -eq "Error") -or ($_.Severity -eq "ParseError")} | ForEach-Object -Process {
[PSCustomObject]@{ [PSCustomObject]@{
@ -30,3 +31,18 @@ jobs:
exit 1 # Exit with a non-zero status to fail the job 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
}

18
.github/workflows/Sophia.yml

@ -17,10 +17,11 @@ jobs:
- name: Run PSScriptAnalyzer - name: Run PSScriptAnalyzer
run: | run: |
# Check module for errors
$Results = @(Get-ChildItem -Path src -File -Recurse -Include *.ps1, *.psm1, *.psd1 | Invoke-ScriptAnalyzer) $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")}) 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 { $Results | Where-Object -FilterScript {($_.Severity -eq "Error") -or ($_.Severity -eq "ParseError")} | ForEach-Object -Process {
[PSCustomObject]@{ [PSCustomObject]@{
@ -33,6 +34,21 @@ jobs:
exit 1 # Exit with a non-zero status to fail the job 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 - name: Download Dependencies
run: | run: |
. "Scripts\Dependencies.ps1" . "Scripts\Dependencies.ps1"

16
Wrapper/Config/config_Windows_10.json

@ -1419,22 +1419,6 @@
"Preset": "Zero", "Preset": "Zero",
"WindowsDefault": "Two" "WindowsDefault": "Two"
}, },
{
"Region": "System",
"Control": "cmb",
"Required": "false",
"Function": "LatestInstalled.NET",
"Arg": {
"Zero": {
"Tag": "Enable"
},
"One": {
"Tag": "Disable"
}
},
"Preset": "Zero",
"WindowsDefault": "One"
},
{ {
"Region": "System", "Region": "System",
"Control": "cmb", "Control": "cmb",

18
Wrapper/Config/config_Windows_10_LTSC.json

@ -1433,24 +1433,6 @@
"LTSC2019": "true", "LTSC2019": "true",
"LTSC2021": "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", "Region": "System",
"Control": "cmb", "Control": "cmb",

16
Wrapper/Config/config_Windows_11.json

@ -1284,22 +1284,6 @@
"Preset": "Zero", "Preset": "Zero",
"WindowsDefault": "Two" "WindowsDefault": "Two"
}, },
{
"Region": "System",
"Control": "cmb",
"Required": "false",
"Function": "LatestInstalled.NET",
"Arg": {
"Zero": {
"Tag": "Enable"
},
"One": {
"Tag": "Disable"
}
},
"Preset": "Zero",
"WindowsDefault": "One"
},
{ {
"Region": "System", "Region": "System",
"Control": "cmb", "Control": "cmb",

16
Wrapper/Config/config_Windows_11_ARM.json

@ -1268,22 +1268,6 @@
"Preset": "Zero", "Preset": "Zero",
"WindowsDefault": "Two" "WindowsDefault": "Two"
}, },
{
"Region": "System",
"Control": "cmb",
"Required": "false",
"Function": "LatestInstalled.NET",
"Arg": {
"Zero": {
"Tag": "Enable"
},
"One": {
"Tag": "Disable"
}
},
"Preset": "Zero",
"WindowsDefault": "One"
},
{ {
"Region": "System", "Region": "System",
"Control": "cmb", "Control": "cmb",

17
Wrapper/Config/config_Windows_11_LTSC.json

@ -1308,23 +1308,6 @@
"WindowsDefault": "Two", "WindowsDefault": "Two",
"LTSC2024": "true" "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", "Region": "System",
"Control": "cmb", "Control": "cmb",

14
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", "Region": "System",
"Function": "WinPrtScrFolder", "Function": "WinPrtScrFolder",

14
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", "Region": "System",
"Function": "WinPrtScrFolder", "Function": "WinPrtScrFolder",

14
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", "Region": "System",
"Function": "WinPrtScrFolder", "Function": "WinPrtScrFolder",

14
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", "Region": "System",
"Function": "WinPrtScrFolder", "Function": "WinPrtScrFolder",

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

@ -15,7 +15,7 @@
}, },
{ {
"Region": "Protection", "Region": "Protection",
"Function": "Logging", "Function": "Logging"
"Arg": { "Arg": {
"Zero": { "Zero": {
"Tag": "", "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", "Region": "System",
"Function": "WinPrtScrFolder", "Function": "WinPrtScrFolder",

14
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", "Region": "System",
"Function": "WinPrtScrFolder", "Function": "WinPrtScrFolder",

14
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", "Region": "System",
"Function": "WinPrtScrFolder", "Function": "WinPrtScrFolder",

14
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", "Region": "System",
"Function": "WinPrtScrFolder", "Function": "WinPrtScrFolder",

14
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", "Region": "System",
"Function": "WinPrtScrFolder", "Function": "WinPrtScrFolder",

52
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 .SYNOPSIS
The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S

10
src/Sophia_Script_for_Windows_10/Sophia.ps1

@ -767,7 +767,7 @@ InputMethod -English
Пользовательские файлы и папки не будут перемещены в новое расположение. Переместите их вручную Пользовательские файлы и папки не будут перемещены в новое расположение. Переместите их вручную
По умолчанию они располагаются в папке %USERPROFILE% По умолчанию они располагаются в папке %USERPROFILE%
#> #>
Set-UserShellFolderLocation -Root Set-UserShellFolderLocation -Root ###
<# <#
Select folders for user folders location manually using a folder browser dialog Select folders for user folders location manually using a folder browser dialog
@ -791,14 +791,6 @@ Set-UserShellFolderLocation -Root
#> #>
# Set-UserShellFolderLocation -Default # 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 # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S
# Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол
WinPrtScrFolder -Desktop WinPrtScrFolder -Desktop

52
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 .SYNOPSIS
The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S

8
src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1

@ -615,14 +615,6 @@ Set-UserShellFolderLocation -Root
#> #>
# Set-UserShellFolderLocation -Default # 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 # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S
# Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол
WinPrtScrFolder -Desktop WinPrtScrFolder -Desktop

52
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 .SYNOPSIS
The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S

8
src/Sophia_Script_for_Windows_10_LTSC_2021/Sophia.ps1

@ -712,14 +712,6 @@ Set-UserShellFolderLocation -Root
#> #>
# Set-UserShellFolderLocation -Default # 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 # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S
# Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол
WinPrtScrFolder -Desktop WinPrtScrFolder -Desktop

52
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 .SYNOPSIS
The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S

8
src/Sophia_Script_for_Windows_10_PowerShell_7/Sophia.ps1

@ -791,14 +791,6 @@ Set-UserShellFolderLocation -Root
#> #>
# Set-UserShellFolderLocation -Default # 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 # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S
# Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол
WinPrtScrFolder -Desktop WinPrtScrFolder -Desktop

3
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} 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 # 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 # https://github.com/PowerShell/PowerShell/issues/21070
Get-ChildItem -Path "$env:TEMP\LGPO.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore Get-ChildItem -Path "$env:TEMP\LGPO.txt" -Force -ErrorAction Ignore | Remove-Item -Force -ErrorAction Ignore

52
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 .SYNOPSIS
The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S

8
src/Sophia_Script_for_Windows_11/Sophia.ps1

@ -765,14 +765,6 @@ Set-UserShellFolderLocation -Root
#> #>
# Set-UserShellFolderLocation -Default # 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 # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S
# Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол
WinPrtScrFolder -Desktop WinPrtScrFolder -Desktop

52
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 .SYNOPSIS
The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S

8
src/Sophia_Script_for_Windows_11_ARM/Sophia.ps1

@ -761,14 +761,6 @@ Set-UserShellFolderLocation -Root
#> #>
# Set-UserShellFolderLocation -Default # 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 # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S
# Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол
WinPrtScrFolder -Desktop WinPrtScrFolder -Desktop

52
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 .SYNOPSIS
The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S

8
src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Sophia.ps1

@ -761,14 +761,6 @@ Set-UserShellFolderLocation -Root
#> #>
# Set-UserShellFolderLocation -Default # 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 # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S
# Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол
WinPrtScrFolder -Desktop WinPrtScrFolder -Desktop

52
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 .SYNOPSIS
The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S

8
src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1

@ -739,14 +739,6 @@ Set-UserShellFolderLocation -Root
#> #>
# Set-UserShellFolderLocation -Default # 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 # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S
# Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол
WinPrtScrFolder -Desktop WinPrtScrFolder -Desktop

52
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 .SYNOPSIS
The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S The location to save screenshots when pressing Windows+PrtScr or using Windows+Shift+S

8
src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1

@ -765,14 +765,6 @@ Set-UserShellFolderLocation -Root
#> #>
# Set-UserShellFolderLocation -Default # 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 # Save screenshots on the Desktop when pressing Windows+PrtScr or using Windows+Shift+S
# Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол # Сохранять скриншоты по нажатию Windows+PrtScr или Windows+Shift+S на рабочий стол
WinPrtScrFolder -Desktop WinPrtScrFolder -Desktop

Loading…
Cancel
Save