diff --git a/Wrapper/Config/config_Windows_10_LTSC.json b/Wrapper/Config/config_Windows_10_LTSC.json index b9c67ec1..815de2a0 100644 --- a/Wrapper/Config/config_Windows_10_LTSC.json +++ b/Wrapper/Config/config_Windows_10_LTSC.json @@ -369,7 +369,7 @@ }, "Preset": "Zero", "WindowsDefault": "One", - "LTSC2019": "false", + "LTSC2019": "true", "LTSC2021": "true" }, { @@ -541,7 +541,7 @@ "Preset": "Zero", "WindowsDefault": "One", "LTSC2019": "true", - "LTSC2021": "false" + "LTSC2021": "true" }, { "Region": "UI & Personalization", @@ -1031,7 +1031,9 @@ } }, "Preset": "Zero", - "WindowsDefault": "Zero" + "WindowsDefault": "Zero", + "LTSC2019": "false", + "LTSC2021": "true" }, { "Region": "UI & Personalization", @@ -1724,7 +1726,9 @@ } }, "Preset": "", - "WindowsDefault": "" + "WindowsDefault": "", + "LTSC2019": "true", + "LTSC2021": "true" }, { "Region": "System", @@ -1799,7 +1803,9 @@ "Preset": "Zero", "WindowsDefault": "One", "Preset2": "0123", - "WindowsDefault2": "" + "WindowsDefault2": "", + "LTSC2019": "false", + "LTSC2021": "true" }, { "Region": "System", diff --git a/Wrapper/Config/config_Windows_11_LTSC.json b/Wrapper/Config/config_Windows_11_LTSC.json index 97fca4fb..f38c98e3 100644 --- a/Wrapper/Config/config_Windows_11_LTSC.json +++ b/Wrapper/Config/config_Windows_11_LTSC.json @@ -630,7 +630,8 @@ } }, "Preset": "Zero", - "WindowsDefault": "One" + "WindowsDefault": "One", + "LTSC2024": "true" }, { "Region": "UI & Personalization", @@ -1492,7 +1493,8 @@ } }, "Preset": "Zero", - "WindowsDefault": "One" + "WindowsDefault": "One", + "LTSC2024": "true" }, { "Region": "System", @@ -1582,7 +1584,8 @@ } }, "Preset": "", - "WindowsDefault": "" + "WindowsDefault": "", + "LTSC2024": "true" }, { "Region": "System", @@ -1689,22 +1692,6 @@ "WindowsDefault": "", "LTSC2024": "true" }, - { - "Region": "UWP apps", - "Control": "chkchkalter", - "Required": "false", - "Separate": "true", - "Function": "Uninstall-UWPApps", - "Function2": "Uninstall-UWPApps -ForAllUsers", - "Arg": { - "Zero": { - "Tag": "" - } - }, - "Preset": "Zero", - "WindowsDefault": "", - "LTSC2024": "true" - }, { "Region": "Gaming", "Control": "cmb", @@ -1958,7 +1945,8 @@ } }, "Preset": "Zero", - "WindowsDefault": "One" + "WindowsDefault": "One", + "LTSC2024": "true" }, { "Region": "Microsoft Defender & Security", diff --git a/src/Sophia_Script_for_Windows_10/Import-TabCompletion.ps1 b/src/Sophia_Script_for_Windows_10/Import-TabCompletion.ps1 index ca3144b4..1a8a35f5 100644 --- a/src/Sophia_Script_for_Windows_10/Import-TabCompletion.ps1 +++ b/src/Sophia_Script_for_Windows_10/Import-TabCompletion.ps1 @@ -259,5 +259,5 @@ Write-Verbose -Message "Sophia -Functions " -Verbose Write-Verbose -Message "Sophia -Functions temp" -Verbose Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal', Uninstall-UWPApps" -Verbose Write-Information -MessageData "" -InformationAction Continue -Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll' -Verbose" +Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll'" -Verbose Write-Verbose -Message "Sophia -Functions `"Set-Association -ProgramPath '%ProgramFiles%\Notepad++\notepad++.exe' -Extension .txt -Icon '%ProgramFiles%\Notepad++\notepad++.exe,0'`"" -Verbose diff --git a/src/Sophia_Script_for_Windows_10/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_10/Module/Private/InitialActions.ps1 index a52c7305..0480a935 100644 --- a/src/Sophia_Script_for_Windows_10/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_10/Module/Private/InitialActions.ps1 @@ -778,40 +778,6 @@ public extern static string BrandingFormatString(string sFormat); exit } - # Checking whether current terminal is Windows Terminal - if ($env:WT_SESSION) - { - # Checking whether Windows Terminal version is higher than 1.23 - # Get Windows Terminal process PID - $ParentProcessID = (Get-CimInstance -ClassName Win32_Process -Filter ProcessID=$PID).ParentProcessID - $WindowsTerminalVersion = (Get-Process -Id $ParentProcessID).FileVersion - # FileVersion has four properties while $WindowsTerminalVersion has only three, unless the [System.Version] accelerator fails - $WindowsTerminalVersion = "{0}.{1}.{2}" -f $WindowsTerminalVersion.Split(".") - - if ([System.Version]$WindowsTerminalVersion -lt [System.Version]"1.23.0") - { - Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message $Localization.UnsupportedWindowsTerminal - Write-Information -MessageData "" -InformationAction Continue - - Start-Process -FilePath "ms-windows-store://pdp/?productid=9N0DX20HK701" - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements" -Verbose - - # Check for UWP apps updates - Get-CimInstance -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 -Namespace root/CIMV2/mdm/dmmap | Invoke-CimMethod -MethodName UpdateScanMethod - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - - $Global:Failed = $true - - exit - } - } - # Detect Windows build version switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber) { diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Import-TabCompletion.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Import-TabCompletion.ps1 index 6dc07915..3c755d50 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Import-TabCompletion.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Import-TabCompletion.ps1 @@ -154,6 +154,6 @@ Register-ArgumentCompleter @Parameters Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "Sophia -Functions " -Verbose Write-Verbose -Message "Sophia -Functions temp" -Verbose -Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal', Uninstall-UWPApps" -Verbose +Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal'" -Verbose Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "Sophia -Functions `"Set-Association -ProgramPath '%ProgramFiles%\Notepad++\notepad++.exe' -Extension .txt -Icon '%ProgramFiles%\Notepad++\notepad++.exe,0'`"" -Verbose diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Private/InitialActions.ps1 index afdbb366..2eff28e9 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Module/Private/InitialActions.ps1 @@ -481,23 +481,14 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); exit } - # Checking whether the Microsoft Store and Windows Feature Experience Pack was removed - $UWPComponents = [Array]::TrueForAll(@( - "Microsoft.WindowsStore", - "MicrosoftWindows.Client.CBS" - ), - [Predicate[string]]{ - param($UWPComponent) - - (Get-AppxPackage -Name $UWPComponent).Status -eq "OK" - }) - if (-not $UWPComponents) + # Checking whether Windows Feature Experience Pack was removed + if (-not (Get-AppxPackage -Name MicrosoftWindows.Client.CBS)) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.WindowsComponentBroken -f "UWP") + Write-Warning -Message ($Localization.WindowsComponentBroken -f "Windows Feature Experience Pack") Write-Information -MessageData "" -InformationAction Continue - Write-Verbose -Message "https://www.microsoft.com/software-download/windows10" -Verbose + Write-Verbose -Message "https://www.microsoft.com/software-download/windows11" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose @@ -779,40 +770,6 @@ public extern static string BrandingFormatString(string sFormat); exit } - # Checking whether current terminal is Windows Terminal - if ($env:WT_SESSION) - { - # Checking whether Windows Terminal version is higher than 1.23 - # Get Windows Terminal process PID - $ParentProcessID = (Get-CimInstance -ClassName Win32_Process -Filter ProcessID=$PID).ParentProcessID - $WindowsTerminalVersion = (Get-Process -Id $ParentProcessID).FileVersion - # FileVersion has four properties while $WindowsTerminalVersion has only three, unless the [System.Version] accelerator fails - $WindowsTerminalVersion = "{0}.{1}.{2}" -f $WindowsTerminalVersion.Split(".") - - if ([System.Version]$WindowsTerminalVersion -lt [System.Version]"1.23.0") - { - Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message $Localization.UnsupportedWindowsTerminal - Write-Information -MessageData "" -InformationAction Continue - - Start-Process -FilePath "ms-windows-store://pdp/?productid=9N0DX20HK701" - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements" -Verbose - - # Check for UWP apps updates - Get-CimInstance -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 -Namespace root/CIMV2/mdm/dmmap | Invoke-CimMethod -MethodName UpdateScanMethod - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - - $Global:Failed = $true - - exit - } - } - # Detect Windows build version switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber) { 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 66c2f43e..07657396 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 @@ -6568,135 +6568,6 @@ public static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntP [WinAPI.wininet]::InternetSetOption(0, $INTERNET_OPTION_REFRESH, 0, 0) } -<# - .SYNOPSIS - Desktop shortcut creation upon Microsoft Edge update - - .PARAMETER Channels - List Microsoft Edge channels to prevent desktop shortcut creation upon its update - - .PARAMETER Disable - Do not prevent desktop shortcut creation upon Microsoft Edge update - - .EXAMPLE - PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary - - .EXAMPLE - PreventEdgeShortcutCreation -Disable - - .NOTES - Machine-wide -#> -function PreventEdgeShortcutCreation -{ - [CmdletBinding()] - param - ( - [Parameter( - Mandatory = $false, - ParameterSetName = "Channels" - )] - [ValidateSet("Stable", "Beta", "Dev", "Canary")] - [string[]] - $Channels, - - [Parameter( - Mandatory = $false, - ParameterSetName = "Disable" - )] - [switch] - $Disable - ) - - if (-not (Get-Package -Name "Microsoft Edge" -ErrorAction Ignore)) - { - Write-Information -MessageData "" -InformationAction Continue - Write-Verbose -Message (($Localization.PackageNotInstalled -f "Microsoft Edge"), ($Localization.Skipped -f $MyInvocation.Line.Trim()) -join " ") -Verbose - Write-Error -Message (($Localization.PackageNotInstalled -f "Microsoft Edge"), ($Localization.Skipped -f $MyInvocation.Line.Trim()) -join " ") -ErrorAction SilentlyContinue - - return - } - - if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate)) - { - New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate -Force - } - - foreach ($Channel in $Channels) - { - switch ($Channel) - { - Stable - { - if (Get-Package -Name "Microsoft Edge" -ErrorAction Ignore) - { - New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}" -PropertyType DWord -Value 0 -Force - # msedgeupdate.admx is not a default ADMX template - if (Test-Path -Path "$env:SystemRoot\PolicyDefinitions\msedgeupdate.admx") - { - Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}" -Type DWORD -Value 3 - } - } - } - Beta - { - if (Get-Package -Name "Microsoft Edge Beta" -ErrorAction Ignore) - { - New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{2CD8A007-E189-409D-A2C8-9AF4EF3C72AA}" -PropertyType DWord -Value 0 -Force - # msedgeupdate.admx is not a default ADMX template - if (Test-Path -Path "$env:SystemRoot\PolicyDefinitions\msedgeupdate.admx") - { - Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{2CD8A007-E189-409D-A2C8-9AF4EF3C72AA}" -Type DWORD -Value 3 - } - } - } - Dev - { - if (Get-Package -Name "Microsoft Edge Dev" -ErrorAction Ignore) - { - New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{0D50BFEC-CD6A-4F9A-964C-C7416E3ACB10}" -PropertyType DWord -Value 0 -Force - # msedgeupdate.admx is not a default ADMX template - if (Test-Path -Path "$env:SystemRoot\PolicyDefinitions\msedgeupdate.admx") - { - Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{0D50BFEC-CD6A-4F9A-964C-C7416E3ACB10}" -Type DWORD -Value 3 - } - } - } - Canary - { - if (Get-Package -Name "Microsoft Edge Canary" -ErrorAction Ignore) - { - New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{65C35B14-6C1D-4122-AC46-7148CC9D6497}" -PropertyType DWord -Value 0 -Force - # msedgeupdate.admx is not a default ADMX template - if (Test-Path -Path "$env:SystemRoot\PolicyDefinitions\msedgeupdate.admx") - { - Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{65C35B14-6C1D-4122-AC46-7148CC9D6497}" -Type DWORD -Value 3 - } - } - } - } - } - - if ($Disable) - { - $Names = @( - "CreateDesktopShortcut{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}", - "CreateDesktopShortcut{2CD8A007-E189-409D-A2C8-9AF4EF3C72AA}", - "CreateDesktopShortcut{0D50BFEC-CD6A-4F9A-964C-C7416E3ACB10}", - "CreateDesktopShortcut{65C35B14-6C1D-4122-AC46-7148CC9D6497}" - ) - Remove-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate -Name $Names -Force -ErrorAction Ignore - - if (Test-Path -Path "$env:SystemRoot\PolicyDefinitions\msedgeupdate.admx") - { - Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}" -Type CLEAR - Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{2CD8A007-E189-409D-A2C8-9AF4EF3C72AA}" -Type CLEAR - Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{0D50BFEC-CD6A-4F9A-964C-C7416E3ACB10}" -Type CLEAR - Set-Policy -Scope Computer -Path SOFTWARE\Policies\Microsoft\EdgeUpdate -Name "CreateDesktopShortcut{65C35B14-6C1D-4122-AC46-7148CC9D6497}" -Type CLEAR - } - } -} - <# .SYNOPSIS Back up the system registry to %SystemRoot%\System32\config\RegBack folder when PC restarts and create a RegIdleBackup in the Task Scheduler task to manage subsequent backups 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 ca80c1b5..8834f1e5 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2019/Sophia.ps1 @@ -707,14 +707,6 @@ AntizapretProxy -Enable # https://antizapret.prostovpn.org # AntizapretProxy -Disable -# List Microsoft Edge channels to prevent desktop shortcut creation upon its update -# Перечислите каналы Microsoft Edge для предотвращения создания ярлыков на рабочем столе после его обновления -PreventEdgeShortcutCreation -Channels Stable, Beta, Dev, Canary - -# Do not prevent desktop shortcut creation upon Microsoft Edge update (default value) -# Не предотвращать создание ярлыков на рабочем столе при обновлении Microsoft Edge (значение по умолчанию) -# PreventEdgeShortcutCreation -Disable - # Back up the system registry to %SystemRoot%\System32\config\RegBack folder when PC restarts and create a RegIdleBackup in the Task Scheduler task to manage subsequent backups # Создавать копии реестра при перезагрузке ПК и задание RegIdleBackup в Планировщике для управления последующими резервными копиями RegistryBackup -Enable diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Import-TabCompletion.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Import-TabCompletion.ps1 index 6b7b20e9..3c3196e0 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Import-TabCompletion.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Import-TabCompletion.ps1 @@ -195,6 +195,6 @@ Register-ArgumentCompleter @Parameters Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "Sophia -Functions " -Verbose Write-Verbose -Message "Sophia -Functions temp" -Verbose -Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal', Uninstall-UWPApps" -Verbose +Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal'" -Verbose Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "Sophia -Functions `"Set-Association -ProgramPath '%ProgramFiles%\Notepad++\notepad++.exe' -Extension .txt -Icon '%ProgramFiles%\Notepad++\notepad++.exe,0'`"" -Verbose diff --git a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Private/InitialActions.ps1 index 2278cc21..aac97211 100644 --- a/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_10_LTSC_2021/Module/Private/InitialActions.ps1 @@ -481,23 +481,14 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); exit } - # Checking whether the Microsoft Store and Windows Feature Experience Pack was removed - $UWPComponents = [Array]::TrueForAll(@( - "Microsoft.WindowsStore", - "MicrosoftWindows.Client.CBS" - ), - [Predicate[string]]{ - param($UWPComponent) - - (Get-AppxPackage -Name $UWPComponent).Status -eq "OK" - }) - if (-not $UWPComponents) + # Checking whether Windows Feature Experience Pack was removed + if (-not (Get-AppxPackage -Name MicrosoftWindows.Client.CBS)) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.WindowsComponentBroken -f "UWP") + Write-Warning -Message ($Localization.WindowsComponentBroken -f "Windows Feature Experience Pack") Write-Information -MessageData "" -InformationAction Continue - Write-Verbose -Message "https://www.microsoft.com/software-download/windows10" -Verbose + Write-Verbose -Message "https://www.microsoft.com/software-download/windows11" -Verbose Write-Verbose -Message "https://t.me/sophia_chat" -Verbose Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose @@ -779,40 +770,6 @@ public extern static string BrandingFormatString(string sFormat); exit } - # Checking whether current terminal is Windows Terminal - if ($env:WT_SESSION) - { - # Checking whether Windows Terminal version is higher than 1.23 - # Get Windows Terminal process PID - $ParentProcessID = (Get-CimInstance -ClassName Win32_Process -Filter ProcessID=$PID).ParentProcessID - $WindowsTerminalVersion = (Get-Process -Id $ParentProcessID).FileVersion - # FileVersion has four properties while $WindowsTerminalVersion has only three, unless the [System.Version] accelerator fails - $WindowsTerminalVersion = "{0}.{1}.{2}" -f $WindowsTerminalVersion.Split(".") - - if ([System.Version]$WindowsTerminalVersion -lt [System.Version]"1.23.0") - { - Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message $Localization.UnsupportedWindowsTerminal - Write-Information -MessageData "" -InformationAction Continue - - Start-Process -FilePath "ms-windows-store://pdp/?productid=9N0DX20HK701" - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements" -Verbose - - # Check for UWP apps updates - Get-CimInstance -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 -Namespace root/CIMV2/mdm/dmmap | Invoke-CimMethod -MethodName UpdateScanMethod - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - - $Global:Failed = $true - - exit - } - } - # Detect Windows build version switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber) { diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Import-TabCompletion.ps1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Import-TabCompletion.ps1 index d46710e7..3e2bcc1e 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Import-TabCompletion.ps1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Import-TabCompletion.ps1 @@ -259,5 +259,5 @@ Write-Verbose -Message "Sophia -Functions " -Verbose Write-Verbose -Message "Sophia -Functions temp" -Verbose Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal', Uninstall-UWPApps" -Verbose Write-Information -MessageData "" -InformationAction Continue -Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll' -Verbose" +Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll'" -Verbose Write-Verbose -Message "Sophia -Functions `"Set-Association -ProgramPath '%ProgramFiles%\Notepad++\notepad++.exe' -Extension .txt -Icon '%ProgramFiles%\Notepad++\notepad++.exe,0'`"" -Verbose diff --git a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Private/InitialActions.ps1 index 9d9e14ff..6c63e2c4 100644 --- a/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Private/InitialActions.ps1 @@ -816,40 +816,6 @@ public extern static string BrandingFormatString(string sFormat); exit } - # Checking whether current terminal is Windows Terminal - if ($env:WT_SESSION) - { - # Checking whether Windows Terminal version is higher than 1.23 - # Get Windows Terminal process PID - $ParentProcessID = (Get-CimInstance -ClassName Win32_Process -Filter ProcessID=$PID).ParentProcessID - $WindowsTerminalVersion = (Get-Process -Id $ParentProcessID).FileVersion - # FileVersion has four properties while $WindowsTerminalVersion has only three, unless the [System.Version] accelerator fails - $WindowsTerminalVersion = "{0}.{1}.{2}" -f $WindowsTerminalVersion.Split(".") - - if ([System.Version]$WindowsTerminalVersion -lt [System.Version]"1.23.0") - { - Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message $Localization.UnsupportedWindowsTerminal - Write-Information -MessageData "" -InformationAction Continue - - Start-Process -FilePath "ms-windows-store://pdp/?productid=9N0DX20HK701" - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements" -Verbose - - # Check for UWP apps updates - Get-CimInstance -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 -Namespace root/CIMV2/mdm/dmmap | Invoke-CimMethod -MethodName UpdateScanMethod - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - - $Global:Failed = $true - - exit - } - } - # Detect Windows build version switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber) { diff --git a/src/Sophia_Script_for_Windows_11/Import-TabCompletion.ps1 b/src/Sophia_Script_for_Windows_11/Import-TabCompletion.ps1 index dadb9909..a251aa0b 100644 --- a/src/Sophia_Script_for_Windows_11/Import-TabCompletion.ps1 +++ b/src/Sophia_Script_for_Windows_11/Import-TabCompletion.ps1 @@ -218,5 +218,5 @@ Write-Verbose -Message "Sophia -Functions " -Verbose Write-Verbose -Message "Sophia -Functions temp" -Verbose Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal', Uninstall-UWPApps" -Verbose Write-Information -MessageData "" -InformationAction Continue -Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll' -Verbose" +Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll'" -Verbose Write-Verbose -Message "Sophia -Functions `"Set-Association -ProgramPath '%ProgramFiles%\Notepad++\notepad++.exe' -Extension .txt -Icon '%ProgramFiles%\Notepad++\notepad++.exe,0'`"" -Verbose diff --git a/src/Sophia_Script_for_Windows_11_ARM/Import-TabCompletion.ps1 b/src/Sophia_Script_for_Windows_11_ARM/Import-TabCompletion.ps1 index c9384d10..3b12bc29 100644 --- a/src/Sophia_Script_for_Windows_11_ARM/Import-TabCompletion.ps1 +++ b/src/Sophia_Script_for_Windows_11_ARM/Import-TabCompletion.ps1 @@ -194,5 +194,5 @@ Write-Verbose -Message "Sophia -Functions " -Verbose Write-Verbose -Message "Sophia -Functions temp" -Verbose Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal', Uninstall-UWPApps" -Verbose Write-Information -MessageData "" -InformationAction Continue -Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll' -Verbose" +Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll'" -Verbose Write-Verbose -Message "Sophia -Functions `"Set-Association -ProgramPath '%ProgramFiles%\Notepad++\notepad++.exe' -Extension .txt -Icon '%ProgramFiles%\Notepad++\notepad++.exe,0'`"" -Verbose diff --git a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Import-TabCompletion.ps1 b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Import-TabCompletion.ps1 index 09f4e2da..b210875d 100644 --- a/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Import-TabCompletion.ps1 +++ b/src/Sophia_Script_for_Windows_11_ARM_PowerShell_7/Import-TabCompletion.ps1 @@ -194,5 +194,5 @@ Write-Verbose -Message "Sophia -Functions " -Verbose Write-Verbose -Message "Sophia -Functions temp" -Verbose Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal', Uninstall-UWPApps" -Verbose Write-Information -MessageData "" -InformationAction Continue -Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll' -Verbose" +Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll'" -Verbose Write-Verbose -Message "Sophia -Functions `"Set-Association -ProgramPath '%ProgramFiles%\Notepad++\notepad++.exe' -Extension .txt -Icon '%ProgramFiles%\Notepad++\notepad++.exe,0'`"" -Verbose diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Import-TabCompletion.ps1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Import-TabCompletion.ps1 index c9384d10..70aad59a 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Import-TabCompletion.ps1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Import-TabCompletion.ps1 @@ -18,7 +18,7 @@ .EXAMPLE Sophia -Functions Sophia -Functions temp - Sophia -Functions "DiagTrackService -Disable", "DiagnosticDataLevel -Minimal", Uninstall-UWPApps + Sophia -Functions "DiagTrackService -Disable", "DiagnosticDataLevel -Minimal" .NOTES Use commas to separate funtions @@ -123,25 +123,6 @@ $Parameters = @{ } } - # If a module command is Uninstall-UWPApps - if ($Command -eq "Uninstall-UWPApps") - { - (Get-Command -Name $Command).Name | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} - - # Get all command arguments, excluding defaults - foreach ($ParameterSet in $ParameterSets.Name) - { - # If an argument is ForAllUsers - if ($ParameterSet -eq "ForAllUsers") - { - # The "Uninstall-UWPApps -ForAllUsers" construction - "Uninstall-UWPApps" + " " + "-" + $ParameterSet | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} - } - - continue - } - } - # If a module command is Install-DotNetRuntimes if ($Command -eq "Install-DotNetRuntimes") { @@ -192,7 +173,7 @@ Register-ArgumentCompleter @Parameters Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "Sophia -Functions " -Verbose Write-Verbose -Message "Sophia -Functions temp" -Verbose -Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal', Uninstall-UWPApps" -Verbose +Write-Verbose -Message "Sophia -Functions 'DiagTrackService -Disable', 'DiagnosticDataLevel -Minimal'" -Verbose Write-Information -MessageData "" -InformationAction Continue -Write-Verbose -Message "Sophia -Functions 'Uninstall-UWPApps, 'PinToStart -UnpinAll' -Verbose" +Write-Verbose -Message "Sophia -Functions 'PinToStart -UnpinAll'" -Verbose Write-Verbose -Message "Sophia -Functions `"Set-Association -ProgramPath '%ProgramFiles%\Notepad++\notepad++.exe' -Extension .txt -Icon '%ProgramFiles%\Notepad++\notepad++.exe,0'`"" -Verbose diff --git a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Private/InitialActions.ps1 b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Private/InitialActions.ps1 index b5957dec..93b1d602 100644 --- a/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Private/InitialActions.ps1 +++ b/src/Sophia_Script_for_Windows_11_LTSC_2024/Module/Private/InitialActions.ps1 @@ -484,20 +484,11 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); exit } - # Checking whether the Microsoft Store and Windows Feature Experience Pack was removed - $UWPComponents = [Array]::TrueForAll(@( - "Microsoft.WindowsStore", - "MicrosoftWindows.Client.CBS" - ), - [Predicate[string]]{ - param($UWPComponent) - - (Get-AppxPackage -Name $UWPComponent).Status -eq "OK" - }) - if (-not $UWPComponents) + # Checking whether Windows Feature Experience Pack was removed + if (-not (Get-AppxPackage -Name MicrosoftWindows.Client.CBS)) { Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message ($Localization.WindowsComponentBroken -f "UWP") + Write-Warning -Message ($Localization.WindowsComponentBroken -f "Windows Feature Experience Pack") Write-Information -MessageData "" -InformationAction Continue Write-Verbose -Message "https://www.microsoft.com/software-download/windows11" -Verbose @@ -782,40 +773,6 @@ public extern static string BrandingFormatString(string sFormat); exit } - # Checking whether current terminal is Windows Terminal - if ($env:WT_SESSION) - { - # Checking whether Windows Terminal version is higher than 1.23 - # Get Windows Terminal process PID - $ParentProcessID = (Get-CimInstance -ClassName Win32_Process -Filter ProcessID=$PID).ParentProcessID - $WindowsTerminalVersion = (Get-Process -Id $ParentProcessID).FileVersion - # FileVersion has four properties while $WindowsTerminalVersion has only three, unless the [System.Version] accelerator fails - $WindowsTerminalVersion = "{0}.{1}.{2}" -f $WindowsTerminalVersion.Split(".") - - if ([System.Version]$WindowsTerminalVersion -lt [System.Version]"1.23.0") - { - Write-Information -MessageData "" -InformationAction Continue - Write-Warning -Message $Localization.UnsupportedWindowsTerminal - Write-Information -MessageData "" -InformationAction Continue - - Start-Process -FilePath "ms-windows-store://pdp/?productid=9N0DX20HK701" - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - Write-Verbose -Message "https://github.com/farag2/Sophia-Script-for-Windows#system-requirements" -Verbose - - # Check for UWP apps updates - Get-CimInstance -ClassName MDM_EnterpriseModernAppManagement_AppManagement01 -Namespace root/CIMV2/mdm/dmmap | Invoke-CimMethod -MethodName UpdateScanMethod - - Write-Verbose -Message "https://t.me/sophia_chat" -Verbose - Write-Verbose -Message "https://discord.gg/sSryhaEv79" -Verbose - - $Global:Failed = $true - - exit - } - } - # Detect Windows build version switch ((Get-CimInstance -ClassName CIM_OperatingSystem).BuildNumber) { 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 5af9a921..2be91d7d 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 @@ -7753,508 +7753,6 @@ function Install-WSL } #endregion WSL -#region UWP apps -<# - .SYNOPSIS - Uninstall UWP apps - - .PARAMETER ForAllUsers - "ForAllUsers" argument sets a checkbox to unistall packages for all users - - .EXAMPLE - Uninstall-UWPApps - - .EXAMPLE - Uninstall-UWPApps -ForAllUsers - - .NOTES - Current user -#> -function Uninstall-UWPApps -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $false)] - [switch] - $ForAllUsers - ) - - Add-Type -AssemblyName PresentationCore, PresentationFramework - - #region Variables - # The following UWP apps will have their checkboxes unchecked - $UncheckedAppxPackages = @( - # Windows Media Player - "Microsoft.ZuneMusic", - - # Screen Sketch - "Microsoft.ScreenSketch", - - # Photos (and Video Editor) - "Microsoft.Windows.Photos", - "Microsoft.Photos.MediaEngineDLC", - - # Calculator - "Microsoft.WindowsCalculator", - - # Windows Advanced Settings - "Microsoft.Windows.DevHome", - - # Windows Camera - "Microsoft.WindowsCamera", - - # Xbox Identity Provider - "Microsoft.XboxIdentityProvider", - - # Xbox Console Companion - "Microsoft.XboxApp", - - # Xbox - "Microsoft.GamingApp", - "Microsoft.GamingServices", - - # Paint - "Microsoft.Paint", - - # Xbox TCUI - "Microsoft.Xbox.TCUI", - - # Xbox Speech To Text Overlay - "Microsoft.XboxSpeechToTextOverlay", - - # Xbox Game Bar - "Microsoft.XboxGamingOverlay", - - # Xbox Game Bar Plugin - "Microsoft.XboxGameOverlay" - ) - - # The following UWP apps will be excluded from the display - $ExcludedAppxPackages = @( - # Dolby Access - "DolbyLaboratories.DolbyAccess", - "DolbyLaboratories.DolbyDigitalPlusDecoderOEM", - - # AMD Radeon Software - "AdvancedMicroDevicesInc-2.AMDRadeonSoftware", - - # Intel Graphics Control Center - "AppUp.IntelGraphicsControlPanel", - "AppUp.IntelGraphicsExperience", - - # ELAN Touchpad - "ELANMicroelectronicsCorpo.ELANTouchpadforThinkpad", - "ELANMicroelectronicsCorpo.ELANTrackPointforThinkpa", - - # Microsoft Application Compatibility Enhancements - "Microsoft.ApplicationCompatibilityEnhancements", - - # AVC Encoder Video Extension - "Microsoft.AVCEncoderVideoExtension", - - # Microsoft Desktop App Installer - "Microsoft.DesktopAppInstaller", - - # Store Experience Host - "Microsoft.StorePurchaseApp", - - # Cross Device Experience Host - "MicrosoftWindows.CrossDevice", - - # Notepad - "Microsoft.WindowsNotepad", - - # Microsoft Store - "Microsoft.WindowsStore", - - # Windows Terminal - "Microsoft.WindowsTerminal", - "Microsoft.WindowsTerminalPreview", - - # Web Media Extensions - "Microsoft.WebMediaExtensions", - - # AV1 Video Extension - "Microsoft.AV1VideoExtension", - - # Windows Subsystem for Linux - "MicrosoftCorporationII.WindowsSubsystemForLinux", - - # HEVC Video Extensions from Device Manufacturer - "Microsoft.HEVCVideoExtension", - "Microsoft.HEVCVideoExtensions", - - # Raw Image Extension - "Microsoft.RawImageExtension", - - # HEIF Image Extensions - "Microsoft.HEIFImageExtension", - - # MPEG-2 Video Extension - "Microsoft.MPEG2VideoExtension", - - # VP9 Video Extensions - "Microsoft.VP9VideoExtensions", - - # Webp Image Extensions - "Microsoft.WebpImageExtension", - - # PowerShell - "Microsoft.PowerShell", - - # NVIDIA Control Panel - "NVIDIACorp.NVIDIAControlPanel", - - # Realtek Audio Console - "RealtekSemiconductorCorp.RealtekAudioControl", - - # Synaptics - "SynapticsIncorporated.SynapticsControlPanel", - "SynapticsIncorporated.241916F58D6E7", - "ELANMicroelectronicsCorpo.ELANTrackPointforThinkpa", - "ELANMicroelectronicsCorpo.TrackPoint" - ) - - #region Variables - #region XAML Markup - # The section defines the design of the upcoming dialog box - [xml]$XAML = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -