Browse Source

Add files via upload

pull/135/head
Dmitry Nefedov 3 years ago
committed by GitHub
parent
commit
ffb85e59fc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 53
      Sophia/LTSC/Sophia.ps1
  2. BIN
      Sophia/LTSC/Sophia.psd1
  3. 567
      Sophia/LTSC/Sophia.psm1
  4. 2
      Sophia/LTSC/cn-CN/Sophia.psd1
  5. 2
      Sophia/LTSC/de-DE/Sophia.psd1
  6. 2
      Sophia/LTSC/en-US/Sophia.psd1
  7. 2
      Sophia/LTSC/es-ES/Sophia.psd1
  8. 2
      Sophia/LTSC/fr-FR/Sophia.psd1
  9. 2
      Sophia/LTSC/it-IT/Sophia.psd1
  10. 2
      Sophia/LTSC/ru-RU/Sophia.psd1
  11. 2
      Sophia/LTSC/tr-TR/Sophia.psd1
  12. 2
      Sophia/LTSC/uk-UA/Sophia.psd1

53
Sophia/LTSC/Sophia.ps1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
Default preset file for "Windows 10 Sophia Script" (LTSC version) Default preset file for "Windows 10 Sophia Script" (LTSC version)
Version: v5.0.2 Version: v5.0.3
Date: 20.01.2021 Date: 04.02.2021
Copyright (c) 2021 farag & oZ-Zo Copyright (c) 2021 farag & oZ-Zo
Thanks to all https://forum.ru-board.com members involved Thanks to all https://forum.ru-board.com members involved
@ -27,7 +27,7 @@
.NOTES .NOTES
https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15 https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15
https://habr.com/post/521202/ https://habr.com/post/521202/
https://forums.mydigitallife.net/threads/powershell-script-setup-windows-10.81675/ https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/
https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/ https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/
.LINK .LINK
@ -47,7 +47,7 @@ param
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script for LTSC v5.0.2 | ©️ farag & oz-zo, 2015–2021" $Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script for LTSC v5.0.3 | ©️ farag & oz-zo, 2015–2021"
Remove-Module -Name Sophia -Force -ErrorAction Ignore Remove-Module -Name Sophia -Force -ErrorAction Ignore
Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force Import-Module -Name $PSScriptRoot\Sophia.psd1 -PassThru -Force
@ -60,14 +60,23 @@ Import-LocalizedData -BindingVariable Global:Localization -FileName Sophia
Добавляет возможность запускать скрипт, указывая в качестве параметров функции модуля Добавляет возможность запускать скрипт, указывая в качестве параметров функции модуля
.EXAMPLE .EXAMPLE
.\Sophia.ps1 -Functions "FunctionName1 -Parameter", "FunctionName2 -Parameter" .\Sophia.ps1 -Functions "FunctionName1 -Parameter", "FunctionName2 -Parameter", FunctionName3
.NOTES
Regardless of the functions entered as an argument, the "Checkings" function will be executed first, and the "Refresh" and "Errors" functions will be executed at the end
Вне зависимости от введенных функций в качестве аргумента, сначала будет выполнена функция "Checkings", и в конце "Refresh" и "Errors"
#> #>
if ($Functions) if ($Functions)
{ {
Invoke-Command -ScriptBlock {Checkings}
foreach ($Function in $Functions) foreach ($Function in $Functions)
{ {
Invoke-Expression -Command $Function Invoke-Expression -Command $Function
} }
Invoke-Command -ScriptBlock {Refresh; Errors}
exit exit
} }
@ -508,30 +517,30 @@ WindowsManageDefaultPrinter -Disable
# WindowsManageDefaultPrinter -Enable # WindowsManageDefaultPrinter -Enable
<# <#
Disable the Windows features using the pop-up dialog box that enables the user to select features to remove Disable the Windows features using the pop-up dialog box
Отключить компоненты Windows, используя всплывающее диалоговое окно, позволяющее пользователю отметить компоненты на удаление Отключить компоненты Windows, используя всплывающее диалоговое окно
If you want to leave "Multimedia settings" in the advanced settings of Power Options do not uninstall this feature If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not uninstall the "MediaPlayback" feature
Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не удаляйте этот компонент Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не удаляйте компонент "MediaPlayback"
#> #>
WindowsFeatures -Disable WindowsFeatures -Disable
# Enable the Windows features using the pop-up dialog box that enables the user to select features to remove # Enable the Windows features using the pop-up dialog box
# Включить компоненты Windows, используя всплывающее диалоговое окно, позволяющее пользователю отметить компоненты на удаление # Включить компоненты Windows, используя всплывающее диалоговое окно
# WindowsFeatures -Enable # WindowsFeatures -Enable
<# <#
Disable Features On Demand v2 (FODv2) capabilities using the pop-up dialog box Uninstall Features On Demand v2 (FODv2) capabilities using the pop-up dialog box
Отключить компоненты "Функции по требованию" (FODv2), используя всплывающее диалоговое окно Удалить компоненты "Функции по требованию" (FODv2), используя всплывающее диалоговое окно
If you want to leave "Multimedia settings" in the advanced settings of Power Options do not uninstall this feature If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not uninstall the "MediaPlayback" feature
Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не удаляйте этот компонент Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не удаляйте компонент "MediaPlayback"
#> #>
WindowsCapabilities -Disable WindowsCapabilities -Uninstall
# Enable Feature On Demand v2 (FODv2) capabilities using the pop-up dialog box # Install Features On Demand v2 (FODv2) capabilities using the pop-up dialog box
# Включить компоненты "Функции по требованию" (FODv2), используя всплывающее диалоговое окно # Установить компоненты "Функции по требованию" (FODv2), используя всплывающее диалоговое окно
# WindowsCapabilities -Enable # WindowsCapabilities -Install
# Opt-in to Microsoft Update service, so to receive updates for other Microsoft products # Opt-in to Microsoft Update service, so to receive updates for other Microsoft products
# Подключаться к службе Microsoft Update так, чтобы при обновлении Windows получать обновления для других продуктов Майкрософт # Подключаться к службе Microsoft Update так, чтобы при обновлении Windows получать обновления для других продуктов Майкрософт
@ -915,14 +924,14 @@ SaveZoneInformation -Disable
<# <#
Disable Windows Script Host (current user only) Disable Windows Script Host (current user only)
It becomes impossible to run .js and .vbs files Blocks WSH from executing .js and .vbs files
Отключить Windows Script Host (только для текущего пользователя) Отключить Windows Script Host (только для текущего пользователя)
Становится невозможным запустить файлы .js и .vbs Блокирует запуск файлов .js и .vbs
#> #>
# WindowsScriptHost -Disable # WindowsScriptHost -Disable
# Emable Windows Script Host (current user only) (default value) # Enable Windows Script Host (current user only) (default value)
# Включить Windows Script Host (только для текущего пользователя) (значение по умолчанию) # Включить Windows Script Host (только для текущего пользователя) (значение по умолчанию)
# WindowsScriptHost -Enable # WindowsScriptHost -Enable

BIN
Sophia/LTSC/Sophia.psd1

Binary file not shown.

567
Sophia/LTSC/Sophia.psm1

@ -2,8 +2,8 @@
.SYNOPSIS .SYNOPSIS
"Windows 10 Sophia Script" (LTSC version) is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks "Windows 10 Sophia Script" (LTSC version) is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks
Version: v5.0.2 Version: v5.0.3
Date: 17.01.2020 Date: 04.02.2021
Copyright (c) 2021 farag & oZ-Zo Copyright (c) 2021 farag & oZ-Zo
Thanks to all https://forum.ru-board.com members involved Thanks to all https://forum.ru-board.com members involved
@ -23,7 +23,7 @@
.NOTES .NOTES
https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15 https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15
https://habr.com/post/521202/ https://habr.com/post/521202/
https://forums.mydigitallife.net/threads/powershell-script-setup-windows-10.81675/ https://forums.mydigitallife.net/threads/powershell-windows-10-sophia-script.81675/
https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/ https://www.reddit.com/r/PowerShell/comments/go2n5v/powershell_script_setup_windows_10/
.LINK .LINK
@ -61,6 +61,35 @@ function Checkings
} }
} }
# Checking whether the current module version is the latest
# Проверка: используется ли последняя версия модуля
try
{
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/farag2/Windows-10-Sophia-Script/master/LTSC/Sophia.psd1" -OutFile $DownloadsFolder\Manifest.psd1 -UseBasicParsing
$LatestRelease = (Import-PowerShellDataFile -Path $DownloadsFolder\Manifest.psd1).ModuleVersion
$CurrentRelease = (Get-Module -Name Sophia).Version.ToString()
Remove-Item -Path $DownloadsFolder\Manifest.psd1 -Force
switch ([System.Version]$LatestRelease -lt [System.Version]$CurrentRelease)
{
$true
{
Write-Warning -Message $Localization.UnsupportedRelease
Start-Sleep -Seconds 5
Start-Process -FilePath "https://github.com/farag2/Windows-10-Sophia-Script/releases/latest"
exit
}
}
}
catch [System.Net.WebException]
{
Write-Warning -Message $Localization.NoInternetConnection
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
}
# Unblock all files in the folder by removing the Zone.Identifier alternate data stream with a value of "3" # Unblock all files in the folder by removing the Zone.Identifier alternate data stream with a value of "3"
# Разблокировать все файлы в папке, удалив альтернативный потоки данных Zone.Identifier со значением "3" # Разблокировать все файлы в папке, удалив альтернативный потоки данных Zone.Identifier со значением "3"
Get-ChildItem -Path $PSScriptRoot -Recurse -Force | Unblock-File -Confirm:$false Get-ChildItem -Path $PSScriptRoot -Recurse -Force | Unblock-File -Confirm:$false
@ -79,6 +108,10 @@ function Checkings
# Открыть раздел "Защита от программ-шантажистов" # Открыть раздел "Защита от программ-шантажистов"
Start-Process -FilePath windowsdefender://RansomwareProtection Start-Process -FilePath windowsdefender://RansomwareProtection
} }
"0"
{
$Script:ControlledFolderAccess = $false
}
} }
} }
#endregion Checkings #endregion Checkings
@ -96,14 +129,23 @@ function Logging
Start-Transcript -Path $PSScriptRoot\$TrascriptFilename.txt -Force Start-Transcript -Path $PSScriptRoot\$TrascriptFilename.txt -Force
} }
# Create a restore point # Create a restore point for the system drive
# Создать точку восстановления # Создать точку восстановления для системного диска
function CreateRestorePoint function CreateRestorePoint
{ {
if (-not (Get-ComputerRestorePoint)) $SystemDriveUniqueID = (Get-Volume | Where-Object {$_.DriveLetter -eq "$($env:SystemDrive[0])"}).UniqueID
$SystemProtection = ((Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SPP\Clients")."{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513}") | Where-Object -FilterScript {$_ -match [regex]::Escape($SystemDriveUniqueID)}
$ComputerRestorePoint = $false
switch ($null -eq $SystemProtection)
{
$true
{ {
$ComputerRestorePoint = $true
Enable-ComputerRestore -Drive $env:SystemDrive Enable-ComputerRestore -Drive $env:SystemDrive
} }
}
# Never skip creating a restore point # Never skip creating a restore point
# Никогда не пропускать создание точек восстановления # Никогда не пропускать создание точек восстановления
@ -114,6 +156,13 @@ function CreateRestorePoint
# Revert the System Restore checkpoint creation frequency to 1440 minutes # Revert the System Restore checkpoint creation frequency to 1440 minutes
# Вернуть частоту создания точек восстановления на 1440 минут # Вернуть частоту создания точек восстановления на 1440 минут
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name SystemRestorePointCreationFrequency -PropertyType DWord -Value 1440 -Force New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name SystemRestorePointCreationFrequency -PropertyType DWord -Value 1440 -Force
# Turn off System Protection for the system drive if it was turned off without deleting existing restore points
# Отключить защиту системы для диска C:\, если был отключен, не удаляя точки восстановления
if ($ComputerRestorePoint)
{
Disable-ComputerRestore -Drive $env:SystemDrive
}
} }
#region Privacy & Telemetry #region Privacy & Telemetry
@ -402,17 +451,13 @@ function ScheduledTasks
Add-Type -AssemblyName PresentationCore, PresentationFramework Add-Type -AssemblyName PresentationCore, PresentationFramework
#region Variables #region Variables
# Initialize an array list to store the scheduled tasks to remove # Initialize an array list to store the selected scheduled tasks
# Создать массив задач для удаления # Создать массив для выбранных задач
$Tasks = New-Object -TypeName System.Collections.ArrayList($null) $SelectedTasks = New-Object -TypeName System.Collections.ArrayList($null)
# The following tasks will have their checkboxes checked # The following tasks will have their checkboxes checked
# Следующие задачи будут иметь чекбоксы отмеченными # Следующие задачи будут иметь чекбоксы отмеченными
$CheckedScheduledTasks = @( [string[]]$CheckedScheduledTasks = @(
# Collects program telemetry information if opted-in to the Microsoft Customer Experience Improvement Program
# Собирает телеметрические данные программы при участии в Программе улучшения качества программного обеспечения Майкрософт
"Microsoft Compatibility Appraiser",
# Collects program telemetry information if opted-in to the Microsoft Customer Experience Improvement Program # Collects program telemetry information if opted-in to the Microsoft Customer Experience Improvement Program
# Сбор телеметрических данных программы при участии в программе улучшения качества ПО # Сбор телеметрических данных программы при участии в программе улучшения качества ПО
"ProgramDataUpdater", "ProgramDataUpdater",
@ -433,14 +478,6 @@ function ScheduledTasks
# Для пользователей, участвующих в программе контроля качества программного обеспечения, служба диагностики дисков Windows предоставляет общие сведения о дисках и системе в корпорацию Майкрософт # Для пользователей, участвующих в программе контроля качества программного обеспечения, служба диагностики дисков Windows предоставляет общие сведения о дисках и системе в корпорацию Майкрософт
"Microsoft-Windows-DiskDiagnosticDataCollector", "Microsoft-Windows-DiskDiagnosticDataCollector",
# Protects user files from accidental loss by copying them to a backup location when the system is unattended
# Защищает файлы пользователя от случайной потери за счет их копирования в резервное расположение, когда система находится в автоматическом режиме
"File History (maintenance mode)",
# Measures a system's performance and capabilities
# Измеряет быстродействие и возможности системы
"WinSAT",
# This task shows various Map related toasts # This task shows various Map related toasts
# Эта задача показывает различные тосты (всплывающие уведомления) приложения "Карты" # Эта задача показывает различные тосты (всплывающие уведомления) приложения "Карты"
"MapsToastTask", "MapsToastTask",
@ -517,7 +554,7 @@ function ScheduledTasks
$Reader = (New-Object -TypeName System.Xml.XmlNodeReader -ArgumentList $XAML) $Reader = (New-Object -TypeName System.Xml.XmlNodeReader -ArgumentList $XAML)
$Form = [Windows.Markup.XamlReader]::Load($Reader) $Form = [Windows.Markup.XamlReader]::Load($Reader)
$XAML.SelectNodes("//*[@*[contains(translate(name(.),'n','N'),'Name')]]") | ForEach-Object -Process { $XAML.SelectNodes("//*[@*[contains(translate(name(.),'n','N'),'Name')]]") | ForEach-Object -Process {
Set-Variable -Name ($_.Name) -Value $Form.FindName($_.Name) -Scope Global Set-Variable -Name ($_.Name) -Value $Form.FindName($_.Name)
} }
#region Functions #region Functions
@ -534,16 +571,18 @@ function ScheduledTasks
$CheckBox $CheckBox
) )
$Task = $CheckBox.Parent.Children[1].Text $Task = $Tasks | Where-Object -FilterScript {$_.TaskName -eq $CheckBox.Parent.Children[1].Text}
if ($CheckBox.IsChecked) if ($CheckBox.IsChecked)
{ {
[void]$Tasks.Add($Task) [void]$SelectedTasks.Add($Task)
} }
else else
{ {
[void]$Tasks.Remove($Task) [void]$SelectedTasks.Remove($Task)
} }
if ($Tasks.Count -gt 0)
if ($SelectedTasks.Count -gt 0)
{ {
$Button.IsEnabled = $true $Button.IsEnabled = $true
} }
@ -555,18 +594,22 @@ function ScheduledTasks
function DisableButton function DisableButton
{ {
Write-Verbose -Message $Localization.Patient -Verbose
[void]$Window.Close() [void]$Window.Close()
$OFS = "|"
Get-ScheduledTask | Where-Object -FilterScript {$_.TaskName -cmatch $Tasks} | Disable-ScheduledTask $SelectedTasks | ForEach-Object -Process {Write-Verbose $_.TaskName -Verbose}
$OFS = " " $SelectedTasks | Disable-ScheduledTask
} }
function EnableButton function EnableButton
{ {
Write-Verbose -Message $Localization.Patient -Verbose
[void]$Window.Close() [void]$Window.Close()
$OFS = "|"
Get-ScheduledTask | Where-Object -FilterScript {$_.TaskName -cmatch $Tasks} | Enable-ScheduledTask $SelectedTasks | ForEach-Object -Process {Write-Verbose $_.TaskName -Verbose}
$OFS = " " $SelectedTasks | Enable-ScheduledTask
} }
function Add-TaskControl function Add-TaskControl
@ -579,30 +622,32 @@ function ScheduledTasks
ValueFromPipeline = $true ValueFromPipeline = $true
)] )]
[ValidateNotNull()] [ValidateNotNull()]
[string]
$Task $Task
) )
process
{
$CheckBox = New-Object -TypeName System.Windows.Controls.CheckBox $CheckBox = New-Object -TypeName System.Windows.Controls.CheckBox
$CheckBox.Add_Click({Get-CheckboxClicked -CheckBox $_.Source}) $CheckBox.Add_Click({Get-CheckboxClicked -CheckBox $_.Source})
$TextBlock = New-Object -TypeName System.Windows.Controls.TextBlock $TextBlock = New-Object -TypeName System.Windows.Controls.TextBlock
$TextBlock.Text = $Task $TextBlock.Text = $Task.TaskName
$StackPanel = New-Object -TypeName System.Windows.Controls.StackPanel $StackPanel = New-Object -TypeName System.Windows.Controls.StackPanel
[void]$StackPanel.Children.Add($CheckBox) [void]$StackPanel.Children.Add($CheckBox)
[void]$StackPanel.Children.Add($TextBlock) [void]$StackPanel.Children.Add($TextBlock)
[void]$PanelContainer.Children.Add($StackPanel) [void]$PanelContainer.Children.Add($StackPanel)
$CheckBox.IsChecked = $false # If task checked add to the array list
# Если задача выделена, то добавить в массив
# If task checked, add to the array list to remove if ($CheckedScheduledTasks | Where-Object -FilterScript {$Task.TaskName -match $_})
# Если задача выделена, то добавить в массив для удаления
if ($CheckedScheduledTasks | Where-Object -FilterScript {$Task -like $_})
{ {
$CheckBox.IsChecked = $true [void]$SelectedTasks.Add($Task)
[void]$Tasks.Add($Task) }
else
{
$CheckBox.IsChecked = $false
}
} }
} }
#endregion Functions #endregion Functions
@ -611,64 +656,37 @@ function ScheduledTasks
{ {
"Enable" "Enable"
{ {
#region Events Handlers
$OptionalTasks = New-Object -TypeName System.Collections.ArrayList($null)
# Window Loaded Event
$Window.Add_Loaded({
$OFS = "|"
$OptionalTasks = @(Get-ScheduledTask | Where-Object -FilterScript {($_.State -eq "Disabled") -and ($_.TaskName -in $CheckedScheduledTasks)})
if ($OptionalTasks.Count -gt 0)
{
$OptionalTasks | ForEach-Object -Process {
Add-TaskControl -Task $_.TaskName
}
$Button.Content = $Localization.Enable
}
else
{
Write-Verbose -Message $Localization.NoData -Verbose
$Form.Close()
}
$OFS = " "
})
# Button Click Event $State = "Disabled"
$Button.Add_Click({EnableButton}) $ButtonContent = $Localization.Enable
#endregion Events Handlers $ButtonAdd_Click = {EnableButton}
} }
"Disable" "Disable"
{ {
#region Events Handlers $State = "Ready"
$OptionalTasks = New-Object System.Collections.ArrayList($null) $ButtonContent = $Localization.Disable
# Window Loaded Event $ButtonAdd_Click = {DisableButton}
$Window.Add_Loaded({
$OFS = "|"
$OptionalTasks = @(Get-ScheduledTask | Where-Object -FilterScript {($_.State -eq "Ready") -and ($_.TaskName -in $CheckedScheduledTasks)})
if ($OptionalTasks.Count -gt 0)
{
$OptionalTasks | ForEach-Object -Process {
Add-TaskControl -Task $_.TaskName
} }
$Button.Content = $Localization.Disable
} }
else
Write-Verbose -Message $Localization.Patient -Verbose
# Получаем общий список задач, согласно условиям
# Getting a list of tasks according to the conditions
$Tasks = Get-ScheduledTask | Where-Object -FilterScript {($_.State -eq $State) -and ($_.TaskName -in $CheckedScheduledTasks)}
if (-not ($Tasks))
{ {
Write-Verbose -Message $Localization.NoData -Verbose Write-Verbose -Message $Localization.NoData -Verbose
$Form.Close() return
}
$OFS = " "
})
# Button Click Event
$Button.Add_Click({DisableButton})
#endregion Events Handlers
}
} }
Write-Verbose -Message $Localization.DialogBoxOpening -Verbose Write-Verbose -Message $Localization.DialogBoxOpening -Verbose
$Window.Add_Loaded({$Tasks | Add-TaskControl})
$Button.Content = $ButtonContent
$Button.Add_Click({& $ButtonAdd_Click})
$Window.Title = $Localization.ScheduledTasks $Window.Title = $Localization.ScheduledTasks
$Form.ShowDialog() | Out-Null $Form.ShowDialog() | Out-Null
} }
@ -2389,16 +2407,21 @@ function TaskManagerWindow
) )
$Taskmgr = Get-Process -Name Taskmgr -ErrorAction Ignore $Taskmgr = Get-Process -Name Taskmgr -ErrorAction Ignore
Start-Sleep -Seconds 1
if ($Taskmgr) if ($Taskmgr)
{ {
$Taskmgr.CloseMainWindow() $Taskmgr.CloseMainWindow()
} }
Start-Process -FilePath Taskmgr.exe -WindowStyle Hidden -PassThru Start-Process -FilePath Taskmgr.exe -PassThru
Start-Sleep -Seconds 3
do do
{ {
Start-Sleep -Milliseconds 100 Start-Sleep -Milliseconds 100
$Preferences = Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -ErrorAction Ignore $Preferences = Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences
} }
until ($Preferences) until ($Preferences)
@ -3516,11 +3539,13 @@ function WindowsManageDefaultPrinter
WindowsFeatures -Enable WindowsFeatures -Enable
.NOTES .NOTES
A pop-up dialog box enables the user to select features to remove A pop-up dialog box enables the user to select features
Current user only Current user only
Используется всплывающее диалоговое окно, позволяющее пользователю отметить компоненты на удаление Используется всплывающее диалоговое окно, позволяющее пользователю отмечать компоненты
Только для текущего пользователя Только для текущего пользователя
Made by https://github.com/oz-zo, iNNOKENTIY21
#> #>
function WindowsFeatures function WindowsFeatures
{ {
@ -3544,13 +3569,13 @@ function WindowsFeatures
Add-Type -AssemblyName PresentationCore, PresentationFramework Add-Type -AssemblyName PresentationCore, PresentationFramework
#region Variables #region Variables
# Initialize an array list to store the Windows Features items to remove # Initialize an array list to store the selected Windows features
# Создать массив имен компонентов Windows для удаления # Создать массив для выбранных компонентов Windows
$Features = New-Object -TypeName System.Collections.ArrayList($null) $SelectedFeatures = New-Object -TypeName System.Collections.ArrayList($null)
# The following Windows Features are recommended the user to remove # The following FODv2 items will have their checkboxes checked
# Следующие компоненты Windows рекомендуются к удалению # Следующие дополнительные компоненты будут иметь чекбоксы отмеченными
$WindowsFeatures = @( [string[]]$CheckedFeatures = @(
# Legacy Components # Legacy Components
# Компоненты прежних версий # Компоненты прежних версий
"LegacyComponents", "LegacyComponents",
@ -3625,7 +3650,7 @@ function WindowsFeatures
$Reader = (New-Object -TypeName System.Xml.XmlNodeReader -ArgumentList $XAML) $Reader = (New-Object -TypeName System.Xml.XmlNodeReader -ArgumentList $XAML)
$Form = [Windows.Markup.XamlReader]::Load($Reader) $Form = [Windows.Markup.XamlReader]::Load($Reader)
$XAML.SelectNodes("//*[@*[contains(translate(name(.),'n','N'),'Name')]]") | ForEach-Object -Process { $XAML.SelectNodes("//*[@*[contains(translate(name(.),'n','N'),'Name')]]") | ForEach-Object -Process {
Set-Variable -Name ($_.Name) -Value $Form.FindName($_.Name) -Scope Global Set-Variable -Name ($_.Name) -Value $Form.FindName($_.Name)
} }
#region Functions #region Functions
@ -3642,16 +3667,17 @@ function WindowsFeatures
$CheckBox $CheckBox
) )
$Feature = $CheckBox.Parent.Children[1].Text $Feature = $Features | Where-Object -FilterScript {$_.DisplayName -eq $CheckBox.Parent.Children[1].Text}
if ($CheckBox.IsChecked) if ($CheckBox.IsChecked)
{ {
[void]$Features.Add($Feature) [void]$SelectedFeatures.Add($Feature)
} }
else else
{ {
[void]$Features.Remove($Feature) [void]$SelectedFeatures.Remove($Feature)
} }
if ($Features.Count -gt 0) if ($SelectedFeatures.Count -gt 0)
{ {
$Button.IsEnabled = $true $Button.IsEnabled = $true
} }
@ -3663,14 +3689,22 @@ function WindowsFeatures
function DisableButton function DisableButton
{ {
Write-Verbose -Message $Localization.Patient -Verbose
[void]$Window.Close() [void]$Window.Close()
Disable-WindowsOptionalFeature -Online -FeatureName $Features -NoRestart
$SelectedFeatures | ForEach-Object -Process {Write-Verbose $_.DisplayName -Verbose}
$SelectedFeatures | Disable-WindowsOptionalFeature -Online -NoRestart
} }
function EnableButton function EnableButton
{ {
Write-Verbose -Message $Localization.Patient -Verbose
[void]$Window.Close() [void]$Window.Close()
Enable-WindowsOptionalFeature -Online -FeatureName $Features -NoRestart
$SelectedFeatures | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedFeatures | Enable-WindowsOptionalFeature -Online -NoRestart
} }
function Add-FeatureControl function Add-FeatureControl
@ -3683,30 +3717,32 @@ function WindowsFeatures
ValueFromPipeline = $true ValueFromPipeline = $true
)] )]
[ValidateNotNull()] [ValidateNotNull()]
[string]
$Feature $Feature
) )
process
{
$CheckBox = New-Object -TypeName System.Windows.Controls.CheckBox $CheckBox = New-Object -TypeName System.Windows.Controls.CheckBox
$CheckBox.Add_Click({Get-CheckboxClicked -CheckBox $_.Source}) $CheckBox.Add_Click({Get-CheckboxClicked -CheckBox $_.Source})
$CheckBox.ToolTip = $Feature.Description
$TextBlock = New-Object -TypeName System.Windows.Controls.TextBlock $TextBlock = New-Object -TypeName System.Windows.Controls.TextBlock
$TextBlock.Text = $Feature $TextBlock.Text = $Feature.DisplayName
$TextBlock.ToolTip = $Feature.Description
$StackPanel = New-Object -TypeName System.Windows.Controls.StackPanel $StackPanel = New-Object -TypeName System.Windows.Controls.StackPanel
[void]$StackPanel.Children.Add($CheckBox) [void]$StackPanel.Children.Add($CheckBox)
[void]$StackPanel.Children.Add($TextBlock) [void]$StackPanel.Children.Add($TextBlock)
[void]$PanelContainer.Children.Add($StackPanel) [void]$PanelContainer.Children.Add($StackPanel)
$CheckBox.IsChecked = $false $CheckBox.IsChecked = $true
# If feature checked, add to the array list to remove # If feature checked add to the array list
# Если компонент выделен, то добавить в массив для удаления # Если компонент выделен, то добавить в массив
if ($WindowsFeatures | Where-Object -FilterScript {$Feature -like $_}) if ($CheckBox.IsChecked)
{ {
$CheckBox.IsChecked = $true [void]$SelectedFeatures.Add($Feature)
[void]$Features.Add($Feature) }
} }
} }
#endregion Functions #endregion Functions
@ -3715,86 +3751,63 @@ function WindowsFeatures
{ {
"Enable" "Enable"
{ {
#region Events Handlers
$OptionalFeatures = New-Object -TypeName System.Collections.ArrayList($null)
# Window Loaded Event
$Window.Add_Loaded({
$OFS = "|"
$OptionalFeatures = Get-WindowsOptionalFeature -Online | Where-Object -FilterScript {($_.State -eq "Disabled" -or $_.State -eq "DisablePending") -and ($_.FeatureName -in $WindowsFeatures)}
if ($OptionalFeatures.Count -gt 0)
{
$OptionalFeatures | ForEach-Object -Process {
Add-FeatureControl -Feature $_.FeatureName
}
$Button.Content = $Localization.Enable $State = @("Disabled", "DisablePending")
$ButtonContent = $Localization.Enable
$ButtonAdd_Click = {EnableButton}
} }
else "Disable"
{ {
Write-Verbose -Message $Localization.NoData -Verbose $State = @("Enabled", "EnablePending")
$Form.Close() $ButtonContent = $Localization.Disable
$ButtonAdd_Click = {DisableButton}
} }
$OFS = " "
})
# Button Click Event
$Button.Add_Click({EnableButton})
#endregion Events Handlers
} }
"Disable"
{ Write-Verbose -Message $Localization.Patient -Verbose
#region Events Handlers
$OptionalFeatures = New-Object -TypeName System.Collections.ArrayList($null) # Получаем общий список дополнительных компонентов, согласно условиям
# Window Loaded Event # Getting a list of features according to the conditions
$Window.Add_Loaded({
$OFS = "|" $OFS = "|"
$OptionalFeatures = Get-WindowsOptionalFeature -Online | Where-Object -FilterScript {($_.State -eq "Enabled" -or $_.State -eq "EnablePending") -and ($_.FeatureName -in $WindowsFeatures)} $Features = Get-WindowsOptionalFeature -Online | Where-Object -FilterScript {
if ($OptionalFeatures.Count -gt 0) ($_.State -in $State) -and ($_.FeatureName -cmatch $CheckedFeatures)
{ } | ForEach-Object -Process {Get-WindowsOptionalFeature -FeatureName $_.FeatureName -Online}
$OptionalFeatures | ForEach-Object -Process { $OFS = " "
Add-FeatureControl -Feature $_.FeatureName
}
$Button.Content = $Localization.Disable if (-not ($Features))
}
else
{ {
Write-Verbose -Message $Localization.NoData -Verbose Write-Verbose -Message $Localization.NoData -Verbose
$Form.Close() return
}
$OFS = " "
})
# Button Click Event
$Button.Add_Click({DisableButton})
#endregion Events Handlers
}
} }
Write-Verbose -Message $Localization.DialogBoxOpening -Verbose Write-Verbose -Message $Localization.DialogBoxOpening -Verbose
$Window.Add_Loaded({$Features | Add-FeatureControl})
$Button.Content = $ButtonContent
$Button.Add_Click({& $ButtonAdd_Click})
$Window.Title = $Localization.WindowsFeaturesWindowTitle $Window.Title = $Localization.WindowsFeaturesWindowTitle
$Form.ShowDialog() | Out-Null $Form.ShowDialog() | Out-Null
} }
<# <#
.SYNOPSIS .SYNOPSIS
Disable/enable Features On Demand v2 (FODv2) capabilities Uninstall/install Features On Demand v2 (FODv2) capabilities
Отключить/включить компоненты "Функции по требованию" (FODv2) Удалить/установить компоненты "Функции по требованию" (FODv2)
.PARAMETER Disable .PARAMETER Uninstall
Disable Features On Demand v2 (FODv2) capabilities Uninstall Features On Demand v2 (FODv2) capabilities
Отключить компоненты "Функции по требованию" (FODv2) Удалить компоненты "Функции по требованию" (FODv2)
.PARAMETER Enable .PARAMETER Install
Enable Features On Demand v2 (FODv2) capabilities Install Features On Demand v2 (FODv2) capabilities
Включить компоненты "Функции по требованию" (FODv2) Установить компоненты "Функции по требованию" (FODv2)
.EXAMPLE .EXAMPLE
WindowsCapabilities -Disable WindowsCapabilities -Uninstall
.EXAMPLE .EXAMPLE
WindowsCapabilities -Enable WindowsCapabilities -Install
.NOTES .NOTES
A pop-up dialog box enables the user to select features A pop-up dialog box enables the user to select features
@ -3803,7 +3816,7 @@ function WindowsFeatures
Используется всплывающее диалоговое окно, позволяющее пользователю отмечать компоненты Используется всплывающее диалоговое окно, позволяющее пользователю отмечать компоненты
Только для текущего пользователя Только для текущего пользователя
Made by https://github.com/oz-zo Made by https://github.com/oz-zo, iNNOKENTIY21
#> #>
function WindowsCapabilities function WindowsCapabilities
{ {
@ -3811,29 +3824,29 @@ function WindowsCapabilities
( (
[Parameter( [Parameter(
Mandatory = $true, Mandatory = $true,
ParameterSetName = "Enable" ParameterSetName = "Install"
)] )]
[switch] [switch]
$Enable, $Install,
[Parameter( [Parameter(
Mandatory = $true, Mandatory = $true,
ParameterSetName = "Disable" ParameterSetName = "Uninstall"
)] )]
[switch] [switch]
$Disable $Uninstall
) )
Add-Type -AssemblyName PresentationCore, PresentationFramework Add-Type -AssemblyName PresentationCore, PresentationFramework
#region Variables #region Variables
# Initialize an array list to store the FODv2 items to disable # Initialize an array list to store the selected FODv2 items
# Создать массив имен дополнительных компонентов для отключения # Создать массив дополнительных компонентов для выбранных элементов
$Capabilities = New-Object -TypeName System.Collections.ArrayList($null) $SelectedCapabilities = New-Object -TypeName System.Collections.ArrayList($null)
# The following FODv2 items will have their checkboxes checked # The following FODv2 items will have their checkboxes checked
# Следующие дополнительные компоненты будут иметь чекбоксы отмеченными # Следующие дополнительные компоненты будут иметь чекбоксы отмеченными
$CheckedCapabilities = @( [string[]]$CheckedCapabilities = @(
# Microsoft Quick Assist # Microsoft Quick Assist
# Быстрая поддержка (Майкрософт) # Быстрая поддержка (Майкрософт)
"App.Support.QuickAssist*" "App.Support.QuickAssist*"
@ -3841,7 +3854,7 @@ function WindowsCapabilities
# The following FODv2 items will have their checkboxes unchecked # The following FODv2 items will have their checkboxes unchecked
# Следующие дополнительные компоненты будут иметь чекбоксы неотмеченными # Следующие дополнительные компоненты будут иметь чекбоксы неотмеченными
$UncheckedCapabilities = @( [string[]]$UncheckedCapabilities = @(
# Internet Explorer 11 # Internet Explorer 11
"Browser.InternetExplorer*", "Browser.InternetExplorer*",
@ -3858,18 +3871,26 @@ function WindowsCapabilities
#> #>
"Media.WindowsMediaPlayer*", "Media.WindowsMediaPlayer*",
# Language components # OpenSSH Client
# Языковые компоненты # Клиент OpenSSH
"OpenSSH.Client*" "OpenSSH.Client*"
) )
# The following FODv2 items will be excluded from the display # The following FODv2 items will be excluded from the display
# Следующие дополнительные компоненты будут исключены из отображения # Следующие дополнительные компоненты будут исключены из отображения
$ExcludedCapabilities = @( [string[]]$ExcludedCapabilities = @(
# The DirectX Database to configure and optimize apps when multiple Graphics Adapters are present
# База данных DirectX для настройки и оптимизации приложений при наличии нескольких графических адаптеров
"DirectX.Configuration.Database*",
# Language components # Language components
# Языковые компоненты # Языковые компоненты
"Language.*", "Language.*",
# Notepad
# Блокнот
"Microsoft.Windows.Notepad*",
# Mail, contacts, and calendar sync component # Mail, contacts, and calendar sync component
# Компонент синхронизации почты, контактов и календаря # Компонент синхронизации почты, контактов и календаря
"OneCoreUAP.OneSync*" "OneCoreUAP.OneSync*"
@ -3923,10 +3944,24 @@ function WindowsCapabilities
$Reader = (New-Object -TypeName System.Xml.XmlNodeReader -ArgumentList $XAML) $Reader = (New-Object -TypeName System.Xml.XmlNodeReader -ArgumentList $XAML)
$Form = [Windows.Markup.XamlReader]::Load($Reader) $Form = [Windows.Markup.XamlReader]::Load($Reader)
$XAML.SelectNodes("//*[@*[contains(translate(name(.),'n','N'),'Name')]]") | ForEach-Object -Process { $XAML.SelectNodes("//*[@*[contains(translate(name(.),'n','N'),'Name')]]") | ForEach-Object -Process {
Set-Variable -Name ($_.Name) -Value $Form.FindName($_.Name) -Scope Global Set-Variable -Name ($_.Name) -Value $Form.FindName($_.Name)
} }
#region Functions #region Functions
function InternetConnectionStatus
{
try
{
(Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription
}
catch [System.Net.WebException]
{
Write-Warning -Message $Localization.NoInternetConnection
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
return
}
}
function Get-CheckboxClicked function Get-CheckboxClicked
{ {
[CmdletBinding()] [CmdletBinding()]
@ -3940,16 +3975,18 @@ function WindowsCapabilities
$CheckBox $CheckBox
) )
$Capability = $CheckBox.Parent.Children[1].Text $Capability = $Capabilities | Where-Object -FilterScript {$_.DisplayName -eq $CheckBox.Parent.Children[1].Text}
if ($CheckBox.IsChecked) if ($CheckBox.IsChecked)
{ {
[void]$Capabilities.Add($Capability) [void]$SelectedCapabilities.Add($Capability)
} }
else else
{ {
[void]$Capabilities.Remove($Capability) [void]$SelectedCapabilities.Remove($Capability)
} }
if ($Capabilities.Count -gt 0)
if ($SelectedCapabilities.Count -gt 0)
{ {
$Button.IsEnabled = $true $Button.IsEnabled = $true
} }
@ -3959,27 +3996,31 @@ function WindowsCapabilities
} }
} }
function DisableButton function UninstallButton
{ {
Write-Verbose -Message $Localization.Patient -Verbose
[void]$Window.Close() [void]$Window.Close()
$OFS = "|"
Get-WindowsCapability -Online | Where-Object -FilterScript {$_.Name -cmatch $Capabilities} | Remove-WindowsCapability -Online
$OFS = " "
if ([string]$Capabilities -cmatch "Browser.InternetExplorer*") $SelectedCapabilities | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedCapabilities | Where-Object -FilterScript {$_.Name -in (Get-WindowsCapability -Online).Name} | Remove-WindowsCapability -Online
if ([string]$SelectedCapabilities.Name -cmatch "Browser.InternetExplorer*")
{ {
Write-Warning -Message $Localization.RestartWarning Write-Warning -Message $Localization.RestartWarning
} }
} }
function EnableButton function InstallButton
{ {
Write-Verbose -Message $Localization.Patient -Verbose
[void]$Window.Close() [void]$Window.Close()
$OFS = "|"
Get-WindowsCapability -Online | Where-Object -FilterScript {$_.Name -cmatch $Capabilities} | Add-WindowsCapability -Online
$OFS = " "
if ([string]$Capabilities -cmatch "Browser.InternetExplorer*") $SelectedCapabilities | ForEach-Object -Process {Write-Verbose -Message $_.DisplayName -Verbose}
$SelectedCapabilities | Where-Object -FilterScript {$_.Name -in ((Get-WindowsCapability -Online).Name)} | Add-WindowsCapability -Online
if ([string]$SelectedCapabilities.Name -cmatch "Browser.InternetExplorer*")
{ {
Write-Warning -Message $Localization.RestartWarning Write-Warning -Message $Localization.RestartWarning
} }
@ -3995,111 +4036,81 @@ function WindowsCapabilities
ValueFromPipeline = $true ValueFromPipeline = $true
)] )]
[ValidateNotNull()] [ValidateNotNull()]
[string]
$Capability $Capability
) )
process
{
$CheckBox = New-Object -TypeName System.Windows.Controls.CheckBox $CheckBox = New-Object -TypeName System.Windows.Controls.CheckBox
$CheckBox.Add_Click({Get-CheckboxClicked -CheckBox $_.Source}) $CheckBox.Add_Click({Get-CheckboxClicked -CheckBox $_.Source})
$CheckBox.ToolTip = $Capability.Description
$TextBlock = New-Object -TypeName System.Windows.Controls.TextBlock $TextBlock = New-Object -TypeName System.Windows.Controls.TextBlock
$TextBlock.Text = $Capability $TextBlock.Text = $Capability.DisplayName
$TextBlock.ToolTip = $Capability.Description
$StackPanel = New-Object -TypeName System.Windows.Controls.StackPanel $StackPanel = New-Object -TypeName System.Windows.Controls.StackPanel
[void]$StackPanel.Children.Add($CheckBox) [void]$StackPanel.Children.Add($CheckBox)
[void]$StackPanel.Children.Add($TextBlock) [void]$StackPanel.Children.Add($TextBlock)
[void]$PanelContainer.Children.Add($StackPanel) [void]$PanelContainer.Children.Add($StackPanel)
# If capability checked, add to the array list to remove # If capability checked add to the array list
# Если компонент выделен, то добавить в массив для удаления # Если компонент выделен, то добавить в массив
if ($UnCheckedCapabilities | Where-Object -FilterScript {$Capability -like $_}) if ($UnCheckedCapabilities | Where-Object -FilterScript {$Capability.Name -like $_})
{ {
$CheckBox.IsChecked = $false $CheckBox.IsChecked = $false
# Exit function, item is not checked # Exit function if item is not checked
# Выход из функции, если элемент не выделен # Выход из функции, если элемент не выделен
return return
} }
# If capability checked, add to the array list to remove # If capability checked add to the array list
# Если компонент выделен, то добавить в массив для удаления # Если компонент выделен, то добавить в массив
[void]$Capabilities.Add($Capability) [void]$SelectedCapabilities.Add($Capability)
}
} }
#endregion Functions #endregion Functions
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
"Enable" "Install"
{ {
try InternetConnectionStatus
{
(Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription $State = "NotPresent"
$ButtonContent = $Localization.Install
$ButtonAdd_Click = {InstallButton}
} }
catch [System.Net.WebException] "Uninstall"
{ {
Write-Warning -Message $Localization.NoInternetConnection $State = "Installed"
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue $ButtonContent = $Localization.Uninstall
return $ButtonAdd_Click = {UninstallButton}
} }
#region Events Handlers
$OptionalCapabilities = New-Object -TypeName System.Collections.ArrayList($null)
# Window Loaded Event
$Window.Add_Loaded({
$OFS = "|"
$OptionalCapabilities = Get-WindowsCapability -Online | Where-Object -FilterScript {($_.State -eq "NotPresent") -and ($_.Name -cmatch $CheckedCapabilities) -($_.Name -cmatch $UncheckedCapabilities) -and ($_.Name -cnotmatch $ExcludedCapabilities)}
if ($OptionalCapabilities.Count -gt 0)
{
$OptionalCapabilities | ForEach-Object -Process {
Add-CapabilityControl -Capability $_.Name
} }
$Button.Content = $Localization.Enable Write-Verbose -Message $Localization.Patient -Verbose
}
else
{
Write-Verbose -Message $Localization.NoData -Verbose
$Form.Close()
}
$OFS = " "
})
# Button Click Event # Получаем общий список дополнительных компонентов, согласно условиям
$Button.Add_Click({EnableButton}) # Getting a list of capabilities according to the conditions
#endregion Events Handlers
}
"Disable"
{
#region Events Handlers
$OptionalCapabilities = New-Object -TypeName System.Collections.ArrayList($null)
# Window Loaded Event
$Window.Add_Loaded({
$OFS = "|" $OFS = "|"
$OptionalCapabilities = Get-WindowsCapability -Online | Where-Object -FilterScript {($_.State -eq "Installed") -and ($_.Name -cnotmatch $ExcludedCapabilities)} $Capabilities = Get-WindowsCapability -Online | Where-Object -FilterScript {
if ($OptionalCapabilities.Count -gt 0) ($_.State -eq $State) -and (($_.Name -cmatch $UncheckedCapabilities) -or ($_.Name -cmatch $CheckedCapabilities) -and ($_.Name -cnotmatch $ExcludedCapabilities))
{ } | ForEach-Object -Process {Get-WindowsCapability -Name $_.Name -Online}
$OptionalCapabilities | ForEach-Object -Process { $OFS = " "
Add-CapabilityControl -Capability $_.Name
}
$Button.Content = $Localization.Disable if (-not ($Capabilities))
}
else
{ {
Write-Verbose -Message $Localization.NoData -Verbose Write-Verbose -Message $Localization.NoData -Verbose
$Form.Close() return
}
$OFS = " "
})
# Button Click Event
$Button.Add_Click({DisableButton})
#endregion Events Handlers
}
} }
Write-Verbose -Message $Localization.DialogBoxOpening -Verbose Write-Verbose -Message $Localization.DialogBoxOpening -Verbose
$Window.Add_Loaded({$Capabilities | Add-CapabilityControl})
$Button.Content = $ButtonContent
$Button.Add_Click({& $ButtonAdd_Click})
$Window.Title = $Localization.FODWindowTitle $Window.Title = $Localization.FODWindowTitle
$Form.ShowDialog() | Out-Null $Form.ShowDialog() | Out-Null
} }
@ -7344,10 +7355,10 @@ function SaveZoneInformation
.NOTES .NOTES
Current user only Current user only
It becomes impossible to run .js and .vbs files Blocks WSH from executing .js and .vbs files
Только для текущего пользователя Только для текущего пользователя
Становится невозможным запустить файлы .js и .vbs Блокирует запуск файлов .js и .vbs
#> #>
function WindowsScriptHost function WindowsScriptHost
{ {
@ -8103,10 +8114,22 @@ function BitmapImageNewContext
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.bmp\ShellNew -Name NullFile -PropertyType String -Value "" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.bmp\ShellNew -Name NullFile -PropertyType String -Value "" -Force
} }
else else
{
try
{
if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription)
{ {
Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*" | Add-WindowsCapability -Online Get-WindowsCapability -Online -Name "Microsoft.Windows.MSPaint*" | Add-WindowsCapability -Online
} }
} }
catch [System.Net.WebException]
{
Write-Warning -Message $Localization.NoInternetConnection
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
return
}
}
}
} }
} }
@ -8169,10 +8192,22 @@ function RichTextDocumentNewContext
New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.rtf\ShellNew -Name ItemName -PropertyType ExpandString -Value "@%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE,-213" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\.rtf\ShellNew -Name ItemName -PropertyType ExpandString -Value "@%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE,-213" -Force
} }
else else
{
try
{
if ((Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing -DisableKeepAlive -Method Head).StatusDescription)
{ {
Get-WindowsCapability -Online -Name "Microsoft.Windows.WordPad*" | Add-WindowsCapability -Online Get-WindowsCapability -Online -Name "Microsoft.Windows.WordPad*" | Add-WindowsCapability -Online
} }
} }
catch [System.Net.WebException]
{
Write-Warning -Message $Localization.NoInternetConnection
Write-Error -Message $Localization.NoInternetConnection -ErrorAction SilentlyContinue
return
}
}
}
} }
} }

2
Sophia/LTSC/cn-CN/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = 该脚本仅支持Windows 10 x64 UnsupportedOSBitness = 该脚本仅支持Windows 10 x64
UnsupportedOSBuild = 该脚本支持Windows 10版本1809 Enterprise LTSC UnsupportedOSBuild = 该脚本支持Windows 10版本1809 Enterprise LTSC
UnsupportedRelease = 找到新版本
ControlledFolderAccessDisabled = 受控文件夹访问禁用 ControlledFolderAccessDisabled = 受控文件夹访问禁用
ScheduledTasks = 计划任务 ScheduledTasks = 计划任务
ClearFolder = 删除"{0}"文件夹中的所有文件? ClearFolder = 删除"{0}"文件夹中的所有文件?
@ -75,4 +76,5 @@ Skip = 跳过
Skipped = 已跳过 Skipped = 已跳过
SymbolicSkipped = 跳过创建符号链接 SymbolicSkipped = 跳过创建符号链接
Uninstall = 卸载 Uninstall = 卸载
Install = 安装
'@ '@

2
Sophia/LTSC/de-DE/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Das Skript unterstützt nur Windows 10 x64 UnsupportedOSBitness = Das Skript unterstützt nur Windows 10 x64
UnsupportedOSBuild = Das Skript unterstützt Windows 10 1809 Enterprise LTSC UnsupportedOSBuild = Das Skript unterstützt Windows 10 1809 Enterprise LTSC
UnsupportedRelease = Neue Version gefunden
ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert ControlledFolderAccessDisabled = Kontrollierter Ordnerzugriff deaktiviert
ScheduledTasks = Geplante Aufgaben ScheduledTasks = Geplante Aufgaben
ClearFolder = Löscht alle Dateien im Ordner "{0}"? ClearFolder = Löscht alle Dateien im Ordner "{0}"?
@ -75,4 +76,5 @@ Skip = Überspringen
Skipped = Übersprungen Skipped = Übersprungen
SymbolicSkipped = Das Erstellen eines symbolischen Links wurde übersprungen SymbolicSkipped = Das Erstellen eines symbolischen Links wurde übersprungen
Uninstall = Deinstallieren Uninstall = Deinstallieren
Install = Installieren
'@ '@

2
Sophia/LTSC/en-US/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = The script supports Windows 10 x64 only UnsupportedOSBitness = The script supports Windows 10 x64 only
UnsupportedOSBuild = The script supports Windows 10 1809 Enterprise LTSC UnsupportedOSBuild = The script supports Windows 10 1809 Enterprise LTSC
UnsupportedRelease = New version found
ControlledFolderAccessDisabled = Controlled folder access disabled ControlledFolderAccessDisabled = Controlled folder access disabled
ScheduledTasks = Scheduled tasks ScheduledTasks = Scheduled tasks
ClearFolder = Delete all files in the "{0}" folder? ClearFolder = Delete all files in the "{0}" folder?
@ -75,4 +76,5 @@ Skip = Skip
Skipped = Skipped Skipped = Skipped
SymbolicSkipped = Skipped creating a symbolic link SymbolicSkipped = Skipped creating a symbolic link
Uninstall = Uninstall Uninstall = Uninstall
Install = Install
'@ '@

2
Sophia/LTSC/es-ES/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Este script solo soporta Windows 10 x64 UnsupportedOSBitness = Este script solo soporta Windows 10 x64
UnsupportedOSBuild = Este script solo soporta Windows 10 1809 Enterprise LTSC UnsupportedOSBuild = Este script solo soporta Windows 10 1809 Enterprise LTSC
UnsupportedRelease = Nueva versión encontrada
ControlledFolderAccessDisabled = Acceso a carpetas controlado desactivado ControlledFolderAccessDisabled = Acceso a carpetas controlado desactivado
ScheduledTasks = Tareas programadas ScheduledTasks = Tareas programadas
ClearFolder = Elimine todos los archivos en la carpeta "{0}"? ClearFolder = Elimine todos los archivos en la carpeta "{0}"?
@ -75,4 +76,5 @@ Skip = Omitir
Skipped = Omitido Skipped = Omitido
SymbolicSkipped = Se omitió la creación de un enlace simbólico SymbolicSkipped = Se omitió la creación de un enlace simbólico
Uninstall = Desinstalar Uninstall = Desinstalar
Install = Instalar
'@ '@

2
Sophia/LTSC/fr-FR/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64 UnsupportedOSBitness = Le script supporte uniquement Windows 10 x64
UnsupportedOSBuild = Le script supporte les versions Windows 10 1809 Enterprise LTSC UnsupportedOSBuild = Le script supporte les versions Windows 10 1809 Enterprise LTSC
UnsupportedRelease = Nouvelle version trouvée
ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé ControlledFolderAccessDisabled = Contrôle d'accès aux dossiers désactivé
ScheduledTasks = Tâches planifiées ScheduledTasks = Tâches planifiées
ClearFolder = Supprimer tous les fichiers dans le dossier "{0}"? ClearFolder = Supprimer tous les fichiers dans le dossier "{0}"?
@ -75,4 +76,5 @@ Skip = Passer
Skipped = Passé Skipped = Passé
SymbolicSkipped = La création d'un lien symbolique a été ignorée SymbolicSkipped = La création d'un lien symbolique a été ignorée
Uninstall = Désinstaller Uninstall = Désinstaller
Install = Installer
'@ '@

2
Sophia/LTSC/it-IT/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Questo script supporta solo Windows 10 x64 UnsupportedOSBitness = Questo script supporta solo Windows 10 x64
UnsupportedOSBuild = Lo script supporta le versioni di Windows 10 1809 Enterprise LTSC UnsupportedOSBuild = Lo script supporta le versioni di Windows 10 1809 Enterprise LTSC
UnsupportedRelease = Nuova versione trovata
ControlledFolderAccessDisabled = Accesso controllato alle cartelle disabilitato ControlledFolderAccessDisabled = Accesso controllato alle cartelle disabilitato
ScheduledTasks = Attività pianificate ScheduledTasks = Attività pianificate
ClearFolder = Elimina tutti i file nella cartella "{0}"? ClearFolder = Elimina tutti i file nella cartella "{0}"?
@ -75,4 +76,5 @@ Skip = Salta
Skipped = Saltato Skipped = Saltato
SymbolicSkipped = È stata saltata la creazione di un collegamento simbolico SymbolicSkipped = È stata saltata la creazione di un collegamento simbolico
Uninstall = Rimuovi Uninstall = Rimuovi
Install = Installare
'@ '@

2
Sophia/LTSC/ru-RU/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Скрипт поддерживает только Windows 10 x64 UnsupportedOSBitness = Скрипт поддерживает только Windows 10 x64
UnsupportedOSBuild = Скрипт поддерживает только Windows 10 версии 1809 Enterprise LTSC UnsupportedOSBuild = Скрипт поддерживает только Windows 10 версии 1809 Enterprise LTSC
UnsupportedRelease = Обнаружена новая версия
ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен ControlledFolderAccessDisabled = Контролируемый доступ к папкам выключен
ScheduledTasks = Запланированные задачи ScheduledTasks = Запланированные задачи
ClearFolder = Удалить все файлы в папке "{0}"? ClearFolder = Удалить все файлы в папке "{0}"?
@ -75,4 +76,5 @@ Skip = Пропустить
Skipped = Пропущено Skipped = Пропущено
SymbolicSkipped = Пропущено создание символической ссылки SymbolicSkipped = Пропущено создание символической ссылки
Uninstall = Удалить Uninstall = Удалить
Install = Установить
'@ '@

2
Sophia/LTSC/tr-TR/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Bu betik sadece Windows 10 x64 destekliyor UnsupportedOSBitness = Bu betik sadece Windows 10 x64 destekliyor
UnsupportedOSBuild = Bu betik sadece Windows 10 1809 Enterprise LTSC UnsupportedOSBuild = Bu betik sadece Windows 10 1809 Enterprise LTSC
UnsupportedRelease = Yeni sürüm bulundu
ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı ControlledFolderAccessDisabled = Kontrollü klasör erişimi devre dışı bırakıldı
ScheduledTasks = Zamanlanan görevler ScheduledTasks = Zamanlanan görevler
ClearFolder = "{0}" klasöründeki tüm dosyaları silin? ClearFolder = "{0}" klasöründeki tüm dosyaları silin?
@ -75,4 +76,5 @@ Skip = Atla
Skipped = Atlandı Skipped = Atlandı
SymbolicSkipped = Sembolik bir bağlantı oluşturma atlandı SymbolicSkipped = Sembolik bir bağlantı oluşturma atlandı
Uninstall = Kaldır Uninstall = Kaldır
Install = Yüklemek
'@ '@

2
Sophia/LTSC/uk-UA/Sophia.psd1

@ -1,6 +1,7 @@
ConvertFrom-StringData -StringData @' ConvertFrom-StringData -StringData @'
UnsupportedOSBitness = Скрипт підтримує тільки Windows 10 x64 UnsupportedOSBitness = Скрипт підтримує тільки Windows 10 x64
UnsupportedOSBuild = Скрипт підтримує тільки Windows 10 1809 Enterprise LTSC UnsupportedOSBuild = Скрипт підтримує тільки Windows 10 1809 Enterprise LTSC
UnsupportedRelease = Виявлено нову версію
ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений ControlledFolderAccessDisabled = Контрольований доступ до папок вимкнений
ScheduledTasks = Заплановані задачі ScheduledTasks = Заплановані задачі
ClearFolder = Видаліть всі файли у папці "{0}"? ClearFolder = Видаліть всі файли у папці "{0}"?
@ -75,4 +76,5 @@ Skip = Пропустити
Skipped = Пропущено Skipped = Пропущено
SymbolicSkipped = Пропущено створення символічного посилання SymbolicSkipped = Пропущено створення символічного посилання
Uninstall = Видалити Uninstall = Видалити
Install = Встановити
'@ '@

Loading…
Cancel
Save