Browse Source

20.01.2020 v5.3.3

pull/125/head
Dmitry Nefedov 4 years ago
committed by GitHub
parent
commit
2b81aa67eb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      LTSC/Sophia.ps1
  2. BIN
      LTSC/Sophia.psd1
  3. 187
      LTSC/Sophia.psm1

40
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.1 Version: v5.0.2
Date: 16.01.2021 Date: 20.01.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
@ -37,15 +37,40 @@
#Requires -RunAsAdministrator #Requires -RunAsAdministrator
#Requires -Version 5.1 #Requires -Version 5.1
[CmdletBinding()]
param
(
[Parameter(Mandatory = $false)]
[string[]]
$Functions
)
Clear-Host Clear-Host
$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script for LTSC v5.0.1 | ©️ farag & oz-zo, 2015–2021" $Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script for LTSC v5.0.2 | ©️ 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
Import-LocalizedData -BindingVariable Global:Localization -FileName Sophia Import-LocalizedData -BindingVariable Global:Localization -FileName Sophia
<#
.SYNOPSIS
Adds the feature to run the script by specifying module functions as parameters
Добавляет возможность запускать скрипт, указывая в качестве параметров функции модуля
.EXAMPLE
.\Sophia.ps1 -Functions "FunctionName1 -Parameter", "FunctionName2 -Parameter"
#>
if ($Functions)
{
foreach ($Function in $Functions)
{
Invoke-Expression -Command $Function
}
exit
}
# Checkings # Checkings
# Проверки # Проверки
Checkings Checkings
@ -801,8 +826,13 @@ PUAppsDetection -Enable
# Выключить обнаружение потенциально нежелательных приложений и блокировать их (значение по умолчанию) # Выключить обнаружение потенциально нежелательных приложений и блокировать их (значение по умолчанию)
# PUAppsDetection -Disable # PUAppsDetection -Disable
# Enable sandboxing for Microsoft Defender <#
# Включить песочницу для Microsoft Defender Enable sandboxing for Microsoft Defender
There is a bug in KVM with QEMU: enabling this function causes VM to freeze up during the loading phase of Windows
Включить песочницу для Microsoft Defender
В KVM с QEMU присутсвует баг: включение этой функции приводит ВМ к зависанию во время загрузки Windows
#>
DefenderSandbox -Enable DefenderSandbox -Enable
# Disable sandboxing for Microsoft Defender (default value) # Disable sandboxing for Microsoft Defender (default value)

BIN
LTSC/Sophia.psd1

Binary file not shown.

187
LTSC/Sophia.psm1

@ -2,7 +2,7 @@
.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.1 Version: v5.0.2
Date: 17.01.2020 Date: 17.01.2020
Copyright (c) 2021 farag & oZ-Zo Copyright (c) 2021 farag & oZ-Zo
@ -22,7 +22,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/en/post/521202/ https://habr.com/post/521202/
https://forums.mydigitallife.net/threads/powershell-script-setup-windows-10.81675/ https://forums.mydigitallife.net/threads/powershell-script-setup-windows-10.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/
@ -30,6 +30,7 @@
https://github.com/farag2/Windows-10-Sophia-Script https://github.com/farag2/Windows-10-Sophia-Script
#> #>
#region Checkings
function Checkings function Checkings
{ {
Set-StrictMode -Version Latest Set-StrictMode -Version Latest
@ -51,7 +52,7 @@ function Checkings
# Detect the OS build version # Detect the OS build version
# Определить номер билда ОС # Определить номер билда ОС
switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -ge 17763) switch ((Get-CimInstance -ClassName Win32_OperatingSystem).BuildNumber -eq 17763)
{ {
$false $false
{ {
@ -66,15 +67,16 @@ function Checkings
# Turn off Controlled folder access to let the script proceed # Turn off Controlled folder access to let the script proceed
# Отключить контролируемый доступ к папкам # Отключить контролируемый доступ к папкам
switch ((Get-MpPreference).EnableControlledFolderAccess -eq 1) switch ((Get-MpPreference).EnableControlledFolderAccess)
{ {
$true "1"
{ {
Write-Warning -Message $Localization.ControlledFolderAccessDisabled Write-Warning -Message $Localization.ControlledFolderAccessDisabled
$Script:ControlledFolderAccess = $true
Set-MpPreference -EnableControlledFolderAccess Disabled Set-MpPreference -EnableControlledFolderAccess Disabled
# Open "Ransomware protection" page # Open "Ransomware protection" page
# Открыть раздел "Защита от программ-шатажистов" # Открыть раздел "Защита от программ-шантажистов"
Start-Process -FilePath windowsdefender://RansomwareProtection Start-Process -FilePath windowsdefender://RansomwareProtection
} }
} }
@ -368,6 +370,15 @@ function WindowsFeedback
.EXAMPLE .EXAMPLE
ScheduledTasks -Enable ScheduledTasks -Enable
.NOTES
A pop-up dialog box enables the user to select tasks
Current user only
Используется всплывающее диалоговое окно, позволяющее пользователю отмечать задачи
Только для текущего пользователя
Made by https://github.com/oz-zo
#> #>
function ScheduledTasks function ScheduledTasks
{ {
@ -1141,7 +1152,6 @@ function FileExtensions
Current user only Current user only
Только для текущего пользователя Только для текущего пользователя
#> #>
function MergeConflicts function MergeConflicts
{ {
param param
@ -1252,7 +1262,6 @@ function OpenFileExplorerTo
Current user only Current user only
Только для текущего пользователя Только для текущего пользователя
#> #>
function TaskViewButton function TaskViewButton
{ {
param param
@ -1308,7 +1317,6 @@ function TaskViewButton
Current user only Current user only
Только для текущего пользователя Только для текущего пользователя
#> #>
function PeopleTaskbar function PeopleTaskbar
{ {
param param
@ -2390,7 +2398,7 @@ function TaskManagerWindow
do do
{ {
Start-Sleep -Milliseconds 100 Start-Sleep -Milliseconds 100
$Preferences = Get-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -ErrorAction Ignore $Preferences = Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -ErrorAction Ignore
} }
until ($Preferences) until ($Preferences)
@ -2400,13 +2408,13 @@ function TaskManagerWindow
{ {
"Expanded" "Expanded"
{ {
$Preferences.Preferences[28] = 0 $Preferences[28] = 0
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -PropertyType Binary -Value $Preferences.Preferences -Force New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -PropertyType Binary -Value $Preferences -Force
} }
"Compact" "Compact"
{ {
$Preferences.Preferences[28] = 1 $Preferences[28] = 1
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -PropertyType Binary -Value $Preferences.Preferences -Force New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\TaskManager -Name Preferences -PropertyType Binary -Value $Preferences -Force
} }
} }
} }
@ -2585,11 +2593,11 @@ function PrtScnSnippingTool
Let/do not let use a different input method for each app window Let/do not let use a different input method for each app window
Позволить/не позволять выбирать метод ввода для каждого окна Позволить/не позволять выбирать метод ввода для каждого окна
.PARAMETER Disable .PARAMETER Enable
Let use a different input method for each app window Let use a different input method for each app window
Позволить выбирать метод ввода для каждого окна Позволить выбирать метод ввода для каждого окна
.PARAMETER Enable .PARAMETER Disable
Do not let use a different input method for each app window Do not let use a different input method for each app window
Не позволять выбирать метод ввода для каждого окна Не позволять выбирать метод ввода для каждого окна
@ -2624,11 +2632,11 @@ function AppsLanguageSwitch
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
"Disable" "Enable"
{ {
Set-WinLanguageBarOption -UseLegacySwitchMode Set-WinLanguageBarOption -UseLegacySwitchMode
} }
"Enable" "Disable"
{ {
Set-WinLanguageBarOption Set-WinLanguageBarOption
} }
@ -3547,8 +3555,13 @@ function WindowsFeatures
# Компоненты прежних версий # Компоненты прежних версий
"LegacyComponents", "LegacyComponents",
# Media Features <#
# Компоненты работы с мультимедиа Media Features
Компоненты работы с мультимедиа
If you want to leave "Multimedia settings" in the advanced settings of Power Options do not uninstall this feature
Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не удаляйте этот компонент
#>
"MediaPlayback", "MediaPlayback",
# PowerShell 2.0 # PowerShell 2.0
@ -3784,11 +3797,13 @@ function WindowsFeatures
WindowsCapabilities -Enable WindowsCapabilities -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
#> #>
function WindowsCapabilities function WindowsCapabilities
{ {
@ -3819,37 +3834,45 @@ function WindowsCapabilities
# The following FODv2 items will have their checkboxes checked # The following FODv2 items will have their checkboxes checked
# Следующие дополнительные компоненты будут иметь чекбоксы отмеченными # Следующие дополнительные компоненты будут иметь чекбоксы отмеченными
$CheckedCapabilities = @( $CheckedCapabilities = @(
# Steps Recorder
# Средство записи действий
"App.StepsRecorder*",
# Microsoft Quick Assist # Microsoft Quick Assist
# Быстрая поддержка (Майкрософт) # Быстрая поддержка (Майкрософт)
"App.Support.QuickAssist*", "App.Support.QuickAssist*"
)
# Windows Media Player # The following FODv2 items will have their checkboxes unchecked
# Проигрыватель Windows Media # Следующие дополнительные компоненты будут иметь чекбоксы неотмеченными
$UncheckedCapabilities = @(
# Internet Explorer 11
"Browser.InternetExplorer*",
# Math Recognizer
# Распознаватель математических знаков
"MathRecognizer*",
<#
Windows Media Player
Проигрыватель Windows Media
If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not uninstall this feature
Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не удаляйте этот компонент
#>
"Media.WindowsMediaPlayer*", "Media.WindowsMediaPlayer*",
# Integrated faxing and scanning application for Windows # Language components
# Факсы и сканирование Windows # Языковые компоненты
"Print.Fax.Scan*" "OpenSSH.Client*"
) )
# The following FODv2 items will be excluded from the display # The following FODv2 items will be excluded from the display
# Следующие дополнительные компоненты будут исключены из отображения # Следующие дополнительные компоненты будут исключены из отображения
$ExcludedCapabilities = @( $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.*",
# Mail, contacts, and calendar sync component # Mail, contacts, and calendar sync component
# Компонент синхронизации почты, контактов и календаря # Компонент синхронизации почты, контактов и календаря
"OneCoreUAP\.OneSync" "OneCoreUAP.OneSync*"
) )
#endregion Variables #endregion Variables
@ -3942,16 +3965,24 @@ function WindowsCapabilities
$OFS = "|" $OFS = "|"
Get-WindowsCapability -Online | Where-Object -FilterScript {$_.Name -cmatch $Capabilities} | Remove-WindowsCapability -Online Get-WindowsCapability -Online | Where-Object -FilterScript {$_.Name -cmatch $Capabilities} | Remove-WindowsCapability -Online
$OFS = " " $OFS = " "
if ([string]$Capabilities -cmatch "Browser.InternetExplorer*")
{
Write-Warning -Message $Localization.RestartWarning
}
} }
function EnableButton function EnableButton
{ {
Write-Verbose -Message $Localization.Patient -Verbose
[void]$Window.Close() [void]$Window.Close()
$OFS = "|" $OFS = "|"
Get-WindowsCapability -Online | Where-Object -FilterScript {$_.Name -cmatch $Capabilities} | Add-WindowsCapability -Online Get-WindowsCapability -Online | Where-Object -FilterScript {$_.Name -cmatch $Capabilities} | Add-WindowsCapability -Online
$OFS = " " $OFS = " "
if ([string]$Capabilities -cmatch "Browser.InternetExplorer*")
{
Write-Warning -Message $Localization.RestartWarning
}
} }
function Add-CapabilityControl function Add-CapabilityControl
@ -3980,28 +4011,43 @@ function WindowsCapabilities
[void]$PanelContainer.Children.Add($StackPanel) [void]$PanelContainer.Children.Add($StackPanel)
# If capability checked, add to the array list to remove
# Если компонент выделен, то добавить в массив для удаления
if ($UnCheckedCapabilities | Where-Object -FilterScript {$Capability -like $_})
{
$CheckBox.IsChecked = $false $CheckBox.IsChecked = $false
# Exit function, item is not checked
# Выход из функции, если элемент не выделен
return
}
# If capability checked, add to the array list to remove # If capability checked, add to the array list to remove
# Если компонент выделен, то добавить в массив для удаления # Если компонент выделен, то добавить в массив для удаления
if ($CheckedCapabilities | Where-Object -FilterScript {$Capability -like $_})
{
$CheckBox.IsChecked = $true
[void]$Capabilities.Add($Capability) [void]$Capabilities.Add($Capability)
} }
}
#endregion Functions #endregion Functions
switch ($PSCmdlet.ParameterSetName) switch ($PSCmdlet.ParameterSetName)
{ {
"Enable" "Enable"
{ {
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
}
#region Events Handlers #region Events Handlers
$OptionalCapabilities = New-Object -TypeName System.Collections.ArrayList($null) $OptionalCapabilities = New-Object -TypeName System.Collections.ArrayList($null)
# Window Loaded Event # Window Loaded Event
$Window.Add_Loaded({ $Window.Add_Loaded({
$OFS = "|" $OFS = "|"
$OptionalCapabilities = Get-WindowsCapability -Online | Where-Object -FilterScript {($_.State -eq "NotPresent") -and ($_.Name -cmatch $CheckedCapabilities) -and ($_.Name -cnotmatch $ExcludedCapabilities)} $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) if ($OptionalCapabilities.Count -gt 0)
{ {
$OptionalCapabilities | ForEach-Object -Process { $OptionalCapabilities | ForEach-Object -Process {
@ -4029,7 +4075,7 @@ function WindowsCapabilities
# Window Loaded Event # Window Loaded Event
$Window.Add_Loaded({ $Window.Add_Loaded({
$OFS = "|" $OFS = "|"
$OptionalCapabilities = Get-WindowsCapability -Online | Where-Object -FilterScript {($_.State -eq "Installed") -and ($_.Name -cmatch $CheckedCapabilities) -and ($_.Name -cnotmatch $ExcludedCapabilities)} $OptionalCapabilities = Get-WindowsCapability -Online | Where-Object -FilterScript {($_.State -eq "Installed") -and ($_.Name -cnotmatch $ExcludedCapabilities)}
if ($OptionalCapabilities.Count -gt 0) if ($OptionalCapabilities.Count -gt 0)
{ {
$OptionalCapabilities | ForEach-Object -Process { $OptionalCapabilities | ForEach-Object -Process {
@ -4052,17 +4098,6 @@ function WindowsCapabilities
} }
} }
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
}
Write-Verbose -Message $Localization.DialogBoxOpening -Verbose Write-Verbose -Message $Localization.DialogBoxOpening -Verbose
$Window.Title = $Localization.FODWindowTitle $Window.Title = $Localization.FODWindowTitle
@ -4412,13 +4447,10 @@ function SetUserShellFolderLocation
$Default $Default
) )
function UserShellFolder
{
<# <#
.SYNOPSIS .SYNOPSIS
Change the location of the each user folder using SHSetKnownFolderPath function Change the location of the each user folder using SHSetKnownFolderPath function
Изменить расположение каждой пользовательской папки, используя функцию "SHSetKnownFolderPath" Изменить расположение каждой пользовательской папки, используя функцию "SHSetKnownFolderPath"
https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath
.PARAMETER RemoveDesktopINI .PARAMETER RemoveDesktopINI
The RemoveDesktopINI argument removes desktop.ini in the old user shell folder The RemoveDesktopINI argument removes desktop.ini in the old user shell folder
@ -4430,7 +4462,11 @@ function SetUserShellFolderLocation
.NOTES .NOTES
User files or folders won't me moved to a new location User files or folders won't me moved to a new location
Пользовательские файлы не будут перенесены в новое расположение Пользовательские файлы не будут перенесены в новое расположение
https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath
#> #>
function UserShellFolder
{
[CmdletBinding()] [CmdletBinding()]
param param
( (
@ -4596,8 +4632,10 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
ShowMenu -Menu $ListOfItems -Default $DefaultChoice ShowMenu -Menu $ListOfItems -Default $DefaultChoice
.NOTES .NOTES
Не работает в PowerShell ISE
Doesn't work in PowerShell ISE Doesn't work in PowerShell ISE
Не работает в PowerShell ISE
https://qna.habr.com/user/MaxKozlov
#> #>
function ShowMenu function ShowMenu
{ {
@ -4678,11 +4716,11 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
# Если количество дисков больше одного, сделать второй диск в списке диском по умолчанию # Если количество дисков больше одного, сделать второй диск в списке диском по умолчанию
if ($DriveLetters.Count -gt 1) if ($DriveLetters.Count -gt 1)
{ {
$Global:Default = 1 $Script:Default = 1
} }
else else
{ {
$Global:Default = 0 $Script:Default = 0
} }
# Desktop # Desktop
@ -4702,7 +4740,7 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
{ {
"0" "0"
{ {
$SelectedDrive = ShowMenu -Title $Localization.DesktopDriveSelect -Menu $DriveLetters -Default $Global:Default $SelectedDrive = ShowMenu -Title $Localization.DesktopDriveSelect -Menu $DriveLetters -Default $Script:Default
UserShellFolder -UserFolder Desktop -FolderPath "${SelectedDrive}:\Desktop" -RemoveDesktopINI UserShellFolder -UserFolder Desktop -FolderPath "${SelectedDrive}:\Desktop" -RemoveDesktopINI
} }
"1" "1"
@ -4728,7 +4766,7 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
{ {
"0" "0"
{ {
$SelectedDrive = ShowMenu -Title $Localization.DocumentsDriveSelect -Menu $DriveLetters -Default $Global:Default $SelectedDrive = ShowMenu -Title $Localization.DocumentsDriveSelect -Menu $DriveLetters -Default $Script:Default
UserShellFolder -UserFolder Documents -FolderPath "${SelectedDrive}:\Documents" -RemoveDesktopINI UserShellFolder -UserFolder Documents -FolderPath "${SelectedDrive}:\Documents" -RemoveDesktopINI
} }
"1" "1"
@ -4754,7 +4792,7 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
{ {
"0" "0"
{ {
$SelectedDrive = ShowMenu -Title $Localization.DownloadsDriveSelect -Menu $DriveLetters -Default $Global:Default $SelectedDrive = ShowMenu -Title $Localization.DownloadsDriveSelect -Menu $DriveLetters -Default $Script:Default
UserShellFolder -UserFolder Downloads -FolderPath "${SelectedDrive}:\Downloads" -RemoveDesktopINI UserShellFolder -UserFolder Downloads -FolderPath "${SelectedDrive}:\Downloads" -RemoveDesktopINI
} }
"1" "1"
@ -4780,7 +4818,7 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
{ {
"0" "0"
{ {
$SelectedDrive = ShowMenu -Title $Localization.MusicDriveSelect -Menu $DriveLetters -Default $Global:Default $SelectedDrive = ShowMenu -Title $Localization.MusicDriveSelect -Menu $DriveLetters -Default $Script:Default
UserShellFolder -UserFolder Music -FolderPath "${SelectedDrive}:\Music" -RemoveDesktopINI UserShellFolder -UserFolder Music -FolderPath "${SelectedDrive}:\Music" -RemoveDesktopINI
} }
"1" "1"
@ -4806,7 +4844,7 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
{ {
"0" "0"
{ {
$SelectedDrive = ShowMenu -Title $Localization.PicturesDriveSelect -Menu $DriveLetters -Default $Global:Default $SelectedDrive = ShowMenu -Title $Localization.PicturesDriveSelect -Menu $DriveLetters -Default $Script:Default
UserShellFolder -UserFolder Pictures -FolderPath "${SelectedDrive}:\Pictures" -RemoveDesktopINI UserShellFolder -UserFolder Pictures -FolderPath "${SelectedDrive}:\Pictures" -RemoveDesktopINI
} }
"1" "1"
@ -4832,7 +4870,7 @@ public extern static int SHSetKnownFolderPath(ref Guid folderId, uint flags, Int
{ {
"0" "0"
{ {
$SelectedDrive = ShowMenu -Title $Localization.VideosDriveSelect -Menu $DriveLetters -Default $Global:Default $SelectedDrive = ShowMenu -Title $Localization.VideosDriveSelect -Menu $DriveLetters -Default $Script:Default
UserShellFolder -UserFolder Videos -FolderPath "${SelectedDrive}:\Videos" -RemoveDesktopINI UserShellFolder -UserFolder Videos -FolderPath "${SelectedDrive}:\Videos" -RemoveDesktopINI
} }
"1" "1"
@ -6814,6 +6852,10 @@ function PUAppsDetection
.EXAMPLE .EXAMPLE
DefenderSandbox -Enable DefenderSandbox -Enable
.NOTES
There is a bug in KVM with QEMU: enabling this function causes VM to freeze up during the loading phase of Windows
В KVM с QEMU присутсвует баг: включение этой функции приводит ВМ к зависанию во время загрузки Windows
#> #>
function DefenderSandbox function DefenderSandbox
{ {
@ -8414,6 +8456,13 @@ public static void PostMessage()
# Перезапустить меню "Пуск" # Перезапустить меню "Пуск"
Stop-Process -Name StartMenuExperienceHost -Force -ErrorAction Ignore Stop-Process -Name StartMenuExperienceHost -Force -ErrorAction Ignore
# Turn on Controlled folder access if it was turned on
# Включить контролируемый доступ к папкам, если был включен
if ($Script:ControlledFolderAccess)
{
Set-MpPreference -EnableControlledFolderAccess Enabled
}
Write-Warning -Message $Localization.RestartWarning Write-Warning -Message $Localization.RestartWarning
} }
#endregion Refresh #endregion Refresh

Loading…
Cancel
Save