From 38571835fc7ae89f076fabeebee552a364f8d367 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Sun, 29 Dec 2024 14:34:36 +0300 Subject: [PATCH] Fixed Microsoft Defender false positive Also renamed `HideRecommendedSection` to `StartRecommendedSection` --- Download_Latest_Sophia.ps1 | 24 +++++------ Scripts/Windows_10.ps1 | 4 +- Scripts/Windows_10_LTSC_2019.ps1 | 4 +- Scripts/Windows_10_LTSC_2021.ps1 | 4 +- Scripts/Windows_10_PS_7.ps1 | 4 +- Scripts/Windows_11.ps1 | 4 +- Scripts/Windows_11_LTSC_2024.ps1 | 4 +- Scripts/Windows_11_PS_7.ps1 | 4 +- Wrapper/Config/config_Windows_11.json | 6 +-- Wrapper/Config/config_Windows_11_LTSC.json | 6 +-- .../de-DE/tooltip_Windows_10.json | 4 +- .../de-DE/tooltip_Windows_11.json | 12 +++--- .../en-US/tooltip_Windows_11.json | 8 ++-- .../ru-RU/tooltip_Windows_11.json | 8 ++-- .../Module/Sophia.psm1 | 8 ++-- .../Module/Sophia.psm1 | 8 ++-- .../Module/Sophia.psm1 | 8 ++-- .../Module/Sophia.psm1 | 20 ++++----- .../Module/Sophia.psm1 | 30 ++++++------- src/Sophia_Script_for_Windows_11/Sophia.ps1 | 8 ++-- .../Module/Sophia.psm1 | 30 ++++++------- .../Sophia.ps1 | 8 ++-- .../Module/Sophia.psm1 | 42 +++++++++---------- .../Sophia.ps1 | 8 ++-- 24 files changed, 133 insertions(+), 133 deletions(-) diff --git a/Download_Latest_Sophia.ps1 b/Download_Latest_Sophia.ps1 index 5e037dfca4..aa940e4ad7 100644 --- a/Download_Latest_Sophia.ps1 +++ b/Download_Latest_Sophia.ps1 @@ -156,7 +156,7 @@ if (Test-Path -Path "$DownloadsFolder\$($Version)_Latest") exit } -New-Item -Path "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin" -ItemType Directory -Force +New-Item -Path "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries" -ItemType Directory -Force & "$env:SystemRoot\System32\tar.exe" -C "$DownloadsFolder\SophiaScriptTemp" -xf "$DownloadsFolder\master.zip" "Sophia-Script-for-Windows-master/src/$Version" @@ -164,23 +164,23 @@ New-Item -Path "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-mast # https://techcommunity.microsoft.com/t5/microsoft-security-baselines/lgpo-exe-local-group-policy-object-utility-v1-0/ba-p/701045 $Parameters = @{ Uri = "https://download.microsoft.com/download/8/5/C/85C25433-A1B0-4FFA-9429-7E023E7DA8D8/LGPO.zip" - OutFile = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\LGPO.zip" + OutFile = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\LGPO.zip" UseBasicParsing = $true Verbose = $true } Invoke-WebRequest @Parameters $Parameters = @{ - Path = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\LGPO.zip" - DestinationPath = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin" + Path = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\LGPO.zip" + DestinationPath = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries" Force = $true Verbose = $true } Expand-Archive @Parameters $Parameters = @{ - Path = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\LGPO_30\LGPO.exe" - Destination = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\LGPO.exe" + Path = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\LGPO_30\LGPO.exe" + Destination = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\LGPO.exe" Force = $true } Move-Item @Parameters @@ -191,19 +191,19 @@ if ($Version -match "PowerShell_7") # https://www.nuget.org/packages/Microsoft.Windows.SDK.NET.Ref $Parameters = @{ Uri = "https://www.nuget.org/api/v2/package/Microsoft.Windows.SDK.NET.Ref" - OutFile = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\microsoft.windows.sdk.net.ref.zip" + OutFile = "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\microsoft.windows.sdk.net.ref.zip" UseBasicParsing = $true } Invoke-RestMethod @Parameters # Extract Microsoft.Windows.SDK.NET.dll & WinRT.Runtime.dll from archive Add-Type -Assembly System.IO.Compression.FileSystem - $ZIP = [IO.Compression.ZipFile]::OpenRead("$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\microsoft.windows.sdk.net.ref.zip") + $ZIP = [IO.Compression.ZipFile]::OpenRead("$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\microsoft.windows.sdk.net.ref.zip") $Entries = $ZIP.Entries | Where-Object -FilterScript {($_.FullName -eq "lib/net8.0/Microsoft.Windows.SDK.NET.dll") -or ($_.FullName -eq "lib/net8.0/WinRT.Runtime.dll")} - $Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\$($_.Name)", $true)} + $Entries | ForEach-Object -Process {[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\$($_.Name)", $true)} $ZIP.Dispose() - Remove-Item -Path "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\bin\microsoft.windows.sdk.net.ref.zip" -Force + Remove-Item -Path "$DownloadsFolder\SophiaScriptTemp\Sophia-Script-for-Windows-master\src\$Version\Binaries\microsoft.windows.sdk.net.ref.zip" -Force } $Parameters = @{ @@ -222,8 +222,8 @@ Move-Item @Parameters $Path = @( "$DownloadsFolder\SophiaScriptTemp", - "$DownloadsFolder\$($Version)_Latest\bin\LGPO_30", - "$DownloadsFolder\$($Version)_Latest\bin\LGPO.zip", + "$DownloadsFolder\$($Version)_Latest\Binaries\LGPO_30", + "$DownloadsFolder\$($Version)_Latest\Binaries\LGPO.zip", "$DownloadsFolder\master.zip" ) Remove-Item -Path $Path -Recurse -Force diff --git a/Scripts/Windows_10.ps1 b/Scripts/Windows_10.ps1 index d716f75a89..783af66cd7 100644 --- a/Scripts/Windows_10.ps1 +++ b/Scripts/Windows_10.ps1 @@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerS Write-Verbose -Message "Sophia.Script.for.Windows.10.v$LatestRelease.zip" -Verbose -New-Item -Path "Sophia_Script_for_Windows_10_v$LatestRelease\bin" -ItemType Directory -Force +New-Item -Path "Sophia_Script_for_Windows_10_v$LatestRelease\Binaries" -ItemType Directory -Force $Parameters = @{ Path = @("Scripts\LGPO.exe") - Destination = "Sophia_Script_for_Windows_10_v$LatestRelease\bin" + Destination = "Sophia_Script_for_Windows_10_v$LatestRelease\Binaries" Recurse = $true Force = $true } diff --git a/Scripts/Windows_10_LTSC_2019.ps1 b/Scripts/Windows_10_LTSC_2019.ps1 index d6f20ad5b6..53441e5dc1 100644 --- a/Scripts/Windows_10_LTSC_2019.ps1 +++ b/Scripts/Windows_10_LTSC_2019.ps1 @@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC20 Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2019.v$LatestRelease.zip" -Verbose -New-Item -Path "Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease\bin" -ItemType Directory -Force +New-Item -Path "Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease\Binaries" -ItemType Directory -Force $Parameters = @{ Path = @("Scripts\LGPO.exe") - Destination = "Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease\bin" + Destination = "Sophia_Script_for_Windows_10_LTSC_2019_v$LatestRelease\Binaries" Recurse = $true Force = $true } diff --git a/Scripts/Windows_10_LTSC_2021.ps1 b/Scripts/Windows_10_LTSC_2021.ps1 index 6bcb4c9eb7..97588cd738 100644 --- a/Scripts/Windows_10_LTSC_2021.ps1 +++ b/Scripts/Windows_10_LTSC_2021.ps1 @@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_LTSC20 Write-Verbose -Message "Sophia.Script.for.Windows.10.LTSC.2021.v$LatestRelease.zip" -Verbose -New-Item -Path "Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease\bin" -ItemType Directory -Force +New-Item -Path "Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease\Binaries" -ItemType Directory -Force $Parameters = @{ Path = @("Scripts\LGPO.exe") - Destination = "Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease\bin" + Destination = "Sophia_Script_for_Windows_10_LTSC_2021_v$LatestRelease\Binaries" Recurse = $true Force = $true } diff --git a/Scripts/Windows_10_PS_7.ps1 b/Scripts/Windows_10_PS_7.ps1 index b1f1901ada..d3c4f071e6 100644 --- a/Scripts/Windows_10_PS_7.ps1 +++ b/Scripts/Windows_10_PS_7.ps1 @@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_10_PowerS Write-Verbose -Message "Sophia.Script.for.Windows.10.PowerShell.7.v$LatestRelease.zip" -Verbose -New-Item -Path "Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease\bin" -ItemType Directory -Force +New-Item -Path "Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease\Binaries" -ItemType Directory -Force $Parameters = @{ Path = @("Scripts\LGPO.exe", "Scripts\WinRT.Runtime.dll", "Scripts\Microsoft.Windows.SDK.NET.dll") - Destination = "Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease\bin" + Destination = "Sophia_Script_for_Windows_10_PowerShell_7_v$LatestRelease\Binaries" Recurse = $true Force = $true } diff --git a/Scripts/Windows_11.ps1 b/Scripts/Windows_11.ps1 index 79445115d9..53ee0965bc 100644 --- a/Scripts/Windows_11.ps1 +++ b/Scripts/Windows_11.ps1 @@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerS Write-Verbose -Message "Sophia.Script.for.Windows.11.v$LatestRelease.zip" -Verbose -New-Item -Path "Sophia_Script_for_Windows_11_v$LatestRelease\bin" -ItemType Directory -Force +New-Item -Path "Sophia_Script_for_Windows_11_v$LatestRelease\Binaries" -ItemType Directory -Force $Parameters = @{ Path = @("Scripts\LGPO.exe") - Destination = "Sophia_Script_for_Windows_11_v$LatestRelease\bin" + Destination = "Sophia_Script_for_Windows_11_v$LatestRelease\Binaries" Recurse = $true Force = $true } diff --git a/Scripts/Windows_11_LTSC_2024.ps1 b/Scripts/Windows_11_LTSC_2024.ps1 index dfed43855a..b2468b6790 100644 --- a/Scripts/Windows_11_LTSC_2024.ps1 +++ b/Scripts/Windows_11_LTSC_2024.ps1 @@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_LTSC20 Write-Verbose -Message "Sophia.Script.for.Windows.11.LTSC.2024.v$LatestRelease.zip" -Verbose -New-Item -Path "Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease\bin" -ItemType Directory -Force +New-Item -Path "Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease\Binaries" -ItemType Directory -Force $Parameters = @{ Path = @("Scripts\LGPO.exe") - Destination = "Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease\bin" + Destination = "Sophia_Script_for_Windows_11_LTSC_2024_v$LatestRelease\Binaries" Recurse = $true Force = $true } diff --git a/Scripts/Windows_11_PS_7.ps1 b/Scripts/Windows_11_PS_7.ps1 index 353f9fcf95..a6cb7d155e 100644 --- a/Scripts/Windows_11_PS_7.ps1 +++ b/Scripts/Windows_11_PS_7.ps1 @@ -6,11 +6,11 @@ $LatestRelease = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerS Write-Verbose -Message "Sophia.Script.for.Windows.11.PowerShell.7.v$LatestRelease.zip" -Verbose -New-Item -Path "Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease\bin" -ItemType Directory -Force +New-Item -Path "Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease\Binaries" -ItemType Directory -Force $Parameters = @{ Path = @("Scripts\LGPO.exe", "Scripts\WinRT.Runtime.dll", "Scripts\Microsoft.Windows.SDK.NET.dll") - Destination = "Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease\bin" + Destination = "Sophia_Script_for_Windows_11_PowerShell_7_v$LatestRelease\Binaries" Recurse = $true Force = $true } diff --git a/Wrapper/Config/config_Windows_11.json b/Wrapper/Config/config_Windows_11.json index 3bf5fda8ab..fac67ec5b9 100644 --- a/Wrapper/Config/config_Windows_11.json +++ b/Wrapper/Config/config_Windows_11.json @@ -876,13 +876,13 @@ "Region": "UI & Personalization", "Control": "cmb", "Required": "false", - "Function": "HideRecommendedSection", + "Function": "StartRecommendedSection", "Arg": { "Zero": { - "Tag": "Disable" + "Tag": "Hide" }, "One": { - "Tag": "Enable" + "Tag": "Show" } }, "Preset": "Zero", diff --git a/Wrapper/Config/config_Windows_11_LTSC.json b/Wrapper/Config/config_Windows_11_LTSC.json index b3790f699a..ff8990a237 100644 --- a/Wrapper/Config/config_Windows_11_LTSC.json +++ b/Wrapper/Config/config_Windows_11_LTSC.json @@ -896,13 +896,13 @@ "Region": "UI & Personalization", "Control": "cmb", "Required": "false", - "Function": "HideRecommendedSection", + "Function": "StartRecommendedSection", "Arg": { "Zero": { - "Tag": "Disable" + "Tag": "Hide" }, "One": { - "Tag": "Enable" + "Tag": "Show" } }, "Preset": "Zero", diff --git a/Wrapper/Localizations/de-DE/tooltip_Windows_10.json b/Wrapper/Localizations/de-DE/tooltip_Windows_10.json index 5ac4d53bd0..a99983e799 100644 --- a/Wrapper/Localizations/de-DE/tooltip_Windows_10.json +++ b/Wrapper/Localizations/de-DE/tooltip_Windows_10.json @@ -830,11 +830,11 @@ "Arg": { "Zero": { "Tag": "Disable", - "ToolTip": "Den Navigatiosbereich des Explorers(Linker Abschnitt) nicht auf den aktuellen Ordner erweitern (aufklappen) (Standardwert)." + "ToolTip": "Den Navigatiosbereich des Explorers (Linker Abschnitt) nicht auf den aktuellen Ordner erweitern (Standardwert)." }, "One": { "Tag": "Enable", - "ToolTip": "Der Navigationsbereich des Explorers(Linker Abschnitt) wird auf den aktuellen Ordner erweitert (aufgeklappt)." + "ToolTip": "Der Navigationsbereich des Explorers (Linker Abschnitt) wird auf den aktuellen Ordner erweitert (aufgeklappt)." } } }, diff --git a/Wrapper/Localizations/de-DE/tooltip_Windows_11.json b/Wrapper/Localizations/de-DE/tooltip_Windows_11.json index e976958c20..6429a81557 100644 --- a/Wrapper/Localizations/de-DE/tooltip_Windows_11.json +++ b/Wrapper/Localizations/de-DE/tooltip_Windows_11.json @@ -760,25 +760,25 @@ "Arg": { "Zero": { "Tag": "Disable", - "ToolTip": "Den Navigatiosbereich des Explorers(Linker Abschnitt) nicht auf den aktuellen Ordner erweitern (Standardwert)." + "ToolTip": "Den Navigatiosbereich des Explorers (Linker Abschnitt) nicht auf den aktuellen Ordner erweitern (Standardwert)." }, "One": { "Tag": "Enable", - "ToolTip": "Der Navigationsbereich des Explorers(Linker Abschnitt) wird auf den aktuellen Ordner erweitert." + "ToolTip": "Der Navigationsbereich des Explorers (Linker Abschnitt) wird auf den aktuellen Ordner erweitert." } } }, { "Region": "UI & Personalization", - "Function": "HideRecommendedSection", + "Function": "StartRecommendedSection", "Arg": { "Zero": { - "Tag": "Disable", + "Tag": "Hide", "ToolTip": "Entfernen Sie den Abschnitt Empfohlen im Startmenü. Gilt nur für die Editionen Enterprise und Education, aber nicht für IoT Enterprise." }, "One": { - "Tag": "Enable", - "ToolTip": "Den Abschnitt Empfohlen im Startmenü nicht entfernen (Standardwert). Gilt nur für die Editionen Enterprise und Education, aber nicht für IoT Enterprise." + "Tag": "Show", + "ToolTip": "Abschnitt Empfohlen im Startmenü anzeigen (Standardwert). Gilt nur für die Editionen Enterprise und Education, aber nicht für IoT Enterprise." } } }, diff --git a/Wrapper/Localizations/en-US/tooltip_Windows_11.json b/Wrapper/Localizations/en-US/tooltip_Windows_11.json index 10546d273f..9f52cda554 100644 --- a/Wrapper/Localizations/en-US/tooltip_Windows_11.json +++ b/Wrapper/Localizations/en-US/tooltip_Windows_11.json @@ -770,15 +770,15 @@ }, { "Region": "UI & Personalization", - "Function": "HideRecommendedSection", + "Function": "StartRecommendedSection", "Arg": { "Zero": { - "Tag": "Disable", + "Tag": "Hide", "ToolTip": "Remove Recommended section in Start Menu. Applicable only to Enterprise and Education editions, but not to IoT Enterprise." }, "One": { - "Tag": "Enable", - "ToolTip": "Do not remove Recommended section in Start Menu (default value). Applicable only to Enterprise and Education editions, but not to IoT Enterprise." + "Tag": "Show", + "ToolTip": "Show Recommended section in Start Menu (default value). Applicable only to Enterprise and Education editions, but not to IoT Enterprise." } } }, diff --git a/Wrapper/Localizations/ru-RU/tooltip_Windows_11.json b/Wrapper/Localizations/ru-RU/tooltip_Windows_11.json index 862c522324..84f5bc838d 100644 --- a/Wrapper/Localizations/ru-RU/tooltip_Windows_11.json +++ b/Wrapper/Localizations/ru-RU/tooltip_Windows_11.json @@ -770,15 +770,15 @@ }, { "Region": "UI & Personalization", - "Function": "HideRecommendedSection", + "Function": "StartRecommendedSection", "Arg": { "Zero": { - "Tag": "Disable", + "Tag": "Hide", "ToolTip": "Удалить раздел \"Рекомендуем\" в меню \"Пуск\". Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise." }, "One": { - "Tag": "Enable", - "ToolTip": "Не удалять раздел \"Рекомендуем\" в меню \"Пуск\". Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise." + "Tag": "Show", + "ToolTip": "Показывать раздел \"Рекомендуем\" в меню \"Пуск\". Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise." } } }, diff --git a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 index 55987a644d..5027127922 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_10/Module/Sophia.psm1 @@ -719,10 +719,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); } # Checking whether LGPO.exe exists in the bin folder - if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe")) + if (-not (Test-Path -Path "$PSScriptRoot\..\Binaries\LGPO.exe")) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\bin")) + Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\Binaries")) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose @@ -15214,11 +15214,11 @@ public static void PostMessage() { if (Test-Path -Path "$env:TEMP\Computer.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\Computer.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" } if (Test-Path -Path "$env:TEMP\User.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\User.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" } gpupdate /force 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 ae352755b0..62d552c711 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 @@ -679,10 +679,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); } # Checking whether LGPO.exe exists in the bin folder - if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe")) + if (-not (Test-Path -Path "$PSScriptRoot\..\Binaries\LGPO.exe")) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\bin")) + Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\Binaries")) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose @@ -11671,11 +11671,11 @@ public static void PostMessage() { if (Test-Path -Path "$env:TEMP\Computer.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\Computer.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" } if (Test-Path -Path "$env:TEMP\User.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\User.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" } gpupdate /force 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 95eab836b2..1e4fcb917d 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 @@ -679,10 +679,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); } # Checking whether LGPO.exe exists in the bin folder - if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe")) + if (-not (Test-Path -Path "$PSScriptRoot\..\Binaries\LGPO.exe")) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\bin")) + Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\Binaries")) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose @@ -13036,11 +13036,11 @@ public static void PostMessage() { if (Test-Path -Path "$env:TEMP\Computer.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\Computer.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" } if (Test-Path -Path "$env:TEMP\User.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\User.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" } gpupdate /force 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 17d020dba5..137479b98f 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 @@ -733,14 +733,14 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); # Checking whether all necessary files exist in the script folder $Files = @( - "$PSScriptRoot\..\bin\LGPO.exe", - "$PSScriptRoot\..\bin\Microsoft.Windows.SDK.NET.dll", - "$PSScriptRoot\..\bin\WinRT.Runtime.dll" + "$PSScriptRoot\..\Binaries\LGPO.exe", + "$PSScriptRoot\..\Binaries\Microsoft.Windows.SDK.NET.dll", + "$PSScriptRoot\..\Binaries\WinRT.Runtime.dll" ) if (($Files | Test-Path) -contains $false) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\bin")) + Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\Binaries")) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose @@ -11155,8 +11155,8 @@ function UninstallUWPApps $ForAllUsers ) - Add-Type -AssemblyName "$PSScriptRoot\..\bin\WinRT.Runtime.dll" - Add-Type -AssemblyName "$PSScriptRoot\..\bin\Microsoft.Windows.SDK.NET.dll" + Add-Type -AssemblyName "$PSScriptRoot\..\Binaries\WinRT.Runtime.dll" + Add-Type -AssemblyName "$PSScriptRoot\..\Binaries\Microsoft.Windows.SDK.NET.dll" Add-Type -AssemblyName PresentationCore, PresentationFramework @@ -15244,11 +15244,11 @@ public static void PostMessage() { if (Test-Path -Path "$env:TEMP\Computer.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\Computer.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" } if (Test-Path -Path "$env:TEMP\User.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\User.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" } gpupdate /force @@ -15332,8 +15332,8 @@ public static void PostMessage() # Determines whether the app can be seen in Settings where the user can turn notifications on or off New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Name ShowInSettings -Value 0 -PropertyType DWord -Force - Add-Type -AssemblyName "$PSScriptRoot\..\bin\WinRT.Runtime.dll" - Add-Type -AssemblyName "$PSScriptRoot\..\bin\Microsoft.Windows.SDK.NET.dll" + Add-Type -AssemblyName "$PSScriptRoot\..\Binaries\WinRT.Runtime.dll" + Add-Type -AssemblyName "$PSScriptRoot\..\Binaries\Microsoft.Windows.SDK.NET.dll" # Telegram group # Extract the localized "Open" string from shell32.dll diff --git a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 index 0a52f5ca6f..0d39901cc3 100644 --- a/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 +++ b/src/Sophia_Script_for_Windows_11/Module/Sophia.psm1 @@ -694,10 +694,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); } # Checking whether LGPO.exe exists in the bin folder - if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe")) + if (-not (Test-Path -Path "$PSScriptRoot\..\Binaries\LGPO.exe")) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\bin")) + Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\Binaries")) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose @@ -4611,38 +4611,38 @@ function NavigationPaneExpand .SYNOPSIS Recommended section in Start Menu - .PARAMETER Enable + .PARAMETER Hide Remove Recommended section in Start Menu - .PARAMETER Disable + .PARAMETER Show Do not remove Recommended section in Start Menu (default value) .EXAMPLE - HideRecommendedSection -Enable + StartRecommendedSection -Hide .EXAMPLE - HideRecommendedSection -Disable + StartRecommendedSection -Show .NOTES Current user #> -function HideRecommendedSection +function StartRecommendedSection { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Hide" )] [switch] - $Enable, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Show" )] [switch] - $Disable + $Show ) # Windows 11 IoT Enterprise not supported @@ -4662,7 +4662,7 @@ function HideRecommendedSection switch ($PSCmdlet.ParameterSetName) { - "Enable" + "Hide" { if (-not (Test-Path -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer)) { @@ -4672,7 +4672,7 @@ function HideRecommendedSection Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1 } - "Disable" + "Show" { Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR @@ -14125,11 +14125,11 @@ public static void PostMessage() { if (Test-Path -Path "$env:TEMP\Computer.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\Computer.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" } if (Test-Path -Path "$env:TEMP\User.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\User.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" } gpupdate /force diff --git a/src/Sophia_Script_for_Windows_11/Sophia.ps1 b/src/Sophia_Script_for_Windows_11/Sophia.ps1 index 9fbc9234d1..31db87ab25 100644 --- a/src/Sophia_Script_for_Windows_11/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11/Sophia.ps1 @@ -604,11 +604,11 @@ NavigationPaneExpand -Disable # Remove Recommended section in Start Menu. Applicable only to Enterprise and Education editions, but not to IoT Enterprise # Удалить раздел "Рекомендуем" в меню "Пуск". Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise -HideRecommendedSection -Enable +StartRecommendedSection -Hide -# Do not remove Recommended section in Start Menu (default value). Applicable only to Enterprise and Education editions, but not to IoT Enterprise -# Не удалять раздел "Рекомендуем" в меню "Пуск" (значение по умолчанию). Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise -# HideRecommendedSection -Disable +# Show Recommended section in Start Menu (default value). Applicable only to Enterprise and Education editions, but not to IoT Enterprise +# Показывать раздел "Рекомендуем" в меню "Пуск" (значение по умолчанию). Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise +# StartRecommendedSection -Show #endregion UI & Personalization #region OneDrive 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 27059bd5fe..e5d005533f 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 @@ -680,10 +680,10 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); } # Checking whether LGPO.exe exists in the bin folder - if (-not (Test-Path -Path "$PSScriptRoot\..\bin\LGPO.exe")) + if (-not (Test-Path -Path "$PSScriptRoot\..\Binaries\LGPO.exe")) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\bin")) + Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\Binaries")) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose @@ -4453,38 +4453,38 @@ function NavigationPaneExpand .SYNOPSIS Recommended section in Start Menu - .PARAMETER Enable + .PARAMETER Hide Remove Recommended section in Start Menu - .PARAMETER Disable + .PARAMETER Show Do not remove Recommended section in Start Menu (default value) .EXAMPLE - HideRecommendedSection -Enable + StartRecommendedSection -Hide .EXAMPLE - HideRecommendedSection -Disable + StartRecommendedSection -Show .NOTES Current user #> -function HideRecommendedSection +function StartRecommendedSection { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Hide" )] [switch] - $Enable, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Show" )] [switch] - $Disable + $Show ) # Windows 11 IoT Enterprise not supported @@ -4504,7 +4504,7 @@ function HideRecommendedSection switch ($PSCmdlet.ParameterSetName) { - "Enable" + "Hide" { if (-not (Test-Path -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer)) { @@ -4514,7 +4514,7 @@ function HideRecommendedSection Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1 } - "Disable" + "Show" { Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR @@ -13039,11 +13039,11 @@ public static void PostMessage() { if (Test-Path -Path "$env:TEMP\Computer.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\Computer.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" } if (Test-Path -Path "$env:TEMP\User.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\User.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" } gpupdate /force 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 e8a8c921d7..42c76264f5 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Sophia.ps1 @@ -590,11 +590,11 @@ NavigationPaneExpand -Disable # Remove Recommended section in Start Menu. Applicable only to Enterprise and Education editions, but not to IoT Enterprise # Удалить раздел "Рекомендуем" в меню "Пуск". Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise -HideRecommendedSection -Enable +StartRecommendedSection -Hide -# Do not remove Recommended section in Start Menu (default value). Applicable only to Enterprise and Education editions, but not to IoT Enterprise -# Не удалять раздел "Рекомендуем" в меню "Пуск" (значение по умолчанию). Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise -# HideRecommendedSection -Disable +# Show Recommended section in Start Menu (default value). Applicable only to Enterprise and Education editions, but not to IoT Enterprise +# Показывать раздел "Рекомендуем" в меню "Пуск" (значение по умолчанию). Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise +# StartRecommendedSection -Show #endregion UI & Personalization #region System 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 8b31e0aa1c..ee7f80af85 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 @@ -708,14 +708,14 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); # Checking whether all necessary files exist in the script folder $Files = @( - "$PSScriptRoot\..\bin\LGPO.exe", - "$PSScriptRoot\..\bin\Microsoft.Windows.SDK.NET.dll", - "$PSScriptRoot\..\bin\WinRT.Runtime.dll" + "$PSScriptRoot\..\Binaries\LGPO.exe", + "$PSScriptRoot\..\Binaries\Microsoft.Windows.SDK.NET.dll", + "$PSScriptRoot\..\Binaries\WinRT.Runtime.dll" ) if (($Files | Test-Path) -contains $false) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\bin")) + Write-Warning -Message ($Localization.Bin -f [IO.Path]::GetFullPath("$PSScriptRoot\..\Binaries")) Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows/releases/latest" -Verbose @@ -4629,38 +4629,38 @@ function NavigationPaneExpand .SYNOPSIS Recommended section in Start Menu - .PARAMETER Enable + .PARAMETER Hide Remove Recommended section in Start Menu - .PARAMETER Disable + .PARAMETER Show Do not remove Recommended section in Start Menu (default value) .EXAMPLE - HideRecommendedSection -Enable + StartRecommendedSection -Hide .EXAMPLE - HideRecommendedSection -Disable + StartRecommendedSection -Show .NOTES Current user #> -function HideRecommendedSection +function StartRecommendedSection { param ( [Parameter( Mandatory = $true, - ParameterSetName = "Enable" + ParameterSetName = "Hide" )] [switch] - $Enable, + $Hide, [Parameter( Mandatory = $true, - ParameterSetName = "Disable" + ParameterSetName = "Show" )] [switch] - $Disable + $Show ) # Windows 11 IoT Enterprise not supported @@ -4680,7 +4680,7 @@ function HideRecommendedSection switch ($PSCmdlet.ParameterSetName) { - "Enable" + "Hide" { if (-not (Test-Path -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer)) { @@ -4690,7 +4690,7 @@ function HideRecommendedSection Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type DWORD -Value 1 } - "Disable" + "Show" { Remove-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Force -ErrorAction Ignore Set-Policy -Scope User -Path SOFTWARE\Policies\Microsoft\Windows\Explorer -Name HideRecommendedSection -Type CLEAR @@ -10351,8 +10351,8 @@ function UninstallUWPApps $ForAllUsers ) - Add-Type -AssemblyName "$PSScriptRoot\..\bin\WinRT.Runtime.dll" - Add-Type -AssemblyName "$PSScriptRoot\..\bin\Microsoft.Windows.SDK.NET.dll" + Add-Type -AssemblyName "$PSScriptRoot\..\Binaries\WinRT.Runtime.dll" + Add-Type -AssemblyName "$PSScriptRoot\..\Binaries\Microsoft.Windows.SDK.NET.dll" Add-Type -AssemblyName PresentationCore, PresentationFramework @@ -14152,11 +14152,11 @@ public static void PostMessage() { if (Test-Path -Path "$env:TEMP\Computer.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\Computer.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\Computer.txt" } if (Test-Path -Path "$env:TEMP\User.txt") { - & "$PSScriptRoot\..\bin\LGPO.exe" /t "$env:TEMP\User.txt" + & "$PSScriptRoot\..\Binaries\LGPO.exe" /t "$env:TEMP\User.txt" } gpupdate /force @@ -14230,8 +14230,8 @@ public static void PostMessage() # Determines whether the app can be seen in Settings where the user can turn notifications on or off New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\AppUserModelId\Sophia -Name ShowInSettings -Value 0 -PropertyType DWord -Force - Add-Type -AssemblyName "$PSScriptRoot\..\bin\WinRT.Runtime.dll" - Add-Type -AssemblyName "$PSScriptRoot\..\bin\Microsoft.Windows.SDK.NET.dll" + Add-Type -AssemblyName "$PSScriptRoot\..\Binaries\WinRT.Runtime.dll" + Add-Type -AssemblyName "$PSScriptRoot\..\Binaries\Microsoft.Windows.SDK.NET.dll" # Telegram group # Extract the localized "Open" string from shell32.dll 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 13bb5c2737..c1a9639cb4 100644 --- a/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_11_PowerShell_7/Sophia.ps1 @@ -608,11 +608,11 @@ NavigationPaneExpand -Disable # Remove Recommended section in Start Menu. Applicable only to Enterprise and Education editions, but not to IoT Enterprise # Удалить раздел "Рекомендуем" в меню "Пуск". Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise -HideRecommendedSection -Enable +StartRecommendedSection -Hide -# Do not remove Recommended section in Start Menu (default value). Applicable only to Enterprise and Education editions, but not to IoT Enterprise -# Не удалять раздел "Рекомендуем" в меню "Пуск" (значение по умолчанию). Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise -# HideRecommendedSection -Disable +# Show Recommended section in Start Menu (default value). Applicable only to Enterprise and Education editions, but not to IoT Enterprise +# Показывать раздел "Рекомендуем" в меню "Пуск" (значение по умолчанию). Применимо только к редакциям Enterprise и Education, но не к IoT Enterprise +# StartRecommendedSection -Show #endregion UI & Personalization #region OneDrive