From c3a33f074dd8c77981095a8d5c9383119b90b7db Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Sun, 20 Jun 2021 19:42:58 +0300 Subject: [PATCH] 20.06.2021 v5.10.8 --- Sophia/PowerShell 5.1/Functions.ps1 | 36 +++- .../Localizations/zh-CN/Sophia.psd1 | 166 +++++++++--------- Sophia/PowerShell 5.1/Manifest/Sophia.psd1 | 2 +- Sophia/PowerShell 5.1/Module/Sophia.psm1 | 120 +++++++++---- Sophia/PowerShell 5.1/Sophia.ps1 | 57 +++--- 5 files changed, 228 insertions(+), 153 deletions(-) diff --git a/Sophia/PowerShell 5.1/Functions.ps1 b/Sophia/PowerShell 5.1/Functions.ps1 index 7f7425bf..7d5ecc72 100644 --- a/Sophia/PowerShell 5.1/Functions.ps1 +++ b/Sophia/PowerShell 5.1/Functions.ps1 @@ -2,11 +2,11 @@ .SYNOPSIS The TAB completion for functions and their arguments - Version: v5.10.7 - Date: 13.06.2021 + Version: v5.10.8 + Date: 20.06.2021 Copyright (c) 2014–2021 farag - Copyright (c) 2019–2021 farag & oZ-Zo + Copyright (c) 2019–2021 farag & Inestic Thanks to all https://forum.ru-board.com members involved @@ -24,7 +24,7 @@ Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force .NOTES - Separate functions with comma + Separate functions with a comma .NOTES https://forum.ru-board.com/topic.cgi?forum=62&topic=30617#15 @@ -66,7 +66,7 @@ function Sophia Clear-Host -$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.10.7 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & oz-zo, 2014–2021" +$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.10.8 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014–2021" Remove-Module -Name Sophia -Force -ErrorAction Ignore Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force @@ -108,7 +108,7 @@ $Parameters = @{ "PinToStart" + " " + "-" + $ParameterSet + " " + $ValidValue | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} } - # "PinToStart -Tiles " construction + # The "PinToStart -Tiles " construction "PinToStart" + " " + "-" + $ParameterSet + " " + ($ValidValues -join ", ") | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} } @@ -116,6 +116,30 @@ $Parameters = @{ } } + # If a module command is UnpinTaskbarShortcuts + if ($Command -eq "UnpinTaskbarShortcuts") + { + # Get all command arguments, excluding defaults + foreach ($ParameterSet in $ParameterSets.Name) + { + # If an argument is Shortcuts + if ($ParameterSet -eq "Shortcuts") + { + $ValidValues = ((Get-Command -Name UnpinTaskbarShortcuts).Parametersets.Parameters | Where-Object -FilterScript {$null -eq $_.Attributes.AliasNames}).Attributes.ValidValues + foreach ($ValidValue in $ValidValues) + { + # The "UnpinTaskbarShortcuts -Shortcuts " construction + "UnpinTaskbarShortcuts" + " " + "-" + $ParameterSet + " " + $ValidValue | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} + } + + # The "UnpinTaskbarShortcuts -Shortcuts " construction + "UnpinTaskbarShortcuts" + " " + "-" + $ParameterSet + " " + ($ValidValues -join ", ") | Where-Object -FilterScript {$_ -like "*$wordToComplete*"} | ForEach-Object -Process {"`"$_`""} + } + + continue + } + } + # If a module command is UninstallUWPApps if ($Command -eq "UninstallUWPApps") { diff --git a/Sophia/PowerShell 5.1/Localizations/zh-CN/Sophia.psd1 b/Sophia/PowerShell 5.1/Localizations/zh-CN/Sophia.psd1 index ffea175c..2f26ff53 100644 --- a/Sophia/PowerShell 5.1/Localizations/zh-CN/Sophia.psd1 +++ b/Sophia/PowerShell 5.1/Localizations/zh-CN/Sophia.psd1 @@ -1,83 +1,83 @@ -ConvertFrom-StringData -StringData @' -UnsupportedOSBitness = 该脚本仅支持Windows 10 x64 -UnsupportedOSBuild = 该脚本支持Windows 10版本2004/20H2/21H1和更高版本 -UnsupportedISE = 该脚本不支持通过Windows PowerShell ISE运行 -UnsupportedRelease = 找到新版本 -CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义Sophia.ps1预设文件中的每个函数? -ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 -ScheduledTasks = 计划任务 -OneDriveUninstalling = 卸载OneDrive…… -OneDriveInstalling = OneDrive正在安装...... -OneDriveDownloading = 正在下载OneDrive...... ~33 MB -WindowsFeaturesTitle = Windows功能 -OptionalFeaturesTitle = 可选功能 -EnableHardwareVT = UEFI中开启虚拟化 -UserShellFolderNotEmpty = 一些文件留在了“{0}“文件夹。请手动将它们移到一个新位置 -RetrievingDrivesList = 取得驱动器列表…… -DriveSelect = 选择将在其根目录中创建“{0}“文件夹的驱动器 -UserFolderRequest = 是否要更改“{0}“文件夹位置? -UserFolderSelect = 为“{0}”文件夹选择一个文件夹 -UserDefaultFolder = 您想将“{0}”文件夹的位置更改为默认值吗? -ReservedStorageIsInUse = 保留存储空间正在使用时不支持此操作。请等待所有服务操作完成后再重试 -ShortcutPinning = “{0}“快捷方式将被固定到开始菜单 -UninstallUWPForAll = 对于所有用户 -UWPAppsTitle = UWP应用 -WSLUpdateDownloading = Linux内核更新包下载中…… ~14 MB -WSLUpdateInstalling = 安装Linux内核更新包…… -HEVCDownloading = Downloading 来自设备制造商的 HEVC 视频扩展... ~2,8 MB -GraphicsPerformanceTitle = 图形性能偏好 -GraphicsPerformanceRequest = 是否将所选应用程序的图形性能设置设为"高性能"? -TaskNotificationTitle = 通知 -CleanupTaskNotificationTitle = 重要信息 -CleanupTaskDescription = 使用内置磁盘清理工具清理未使用的Windows文件和更新 -CleanupTaskNotificationEventTitle = 运行任务以清理Windows未使用的文件和更新? -CleanupTaskNotificationEvent = Windows清理不会花很长时间。下次通知将在30天内显示 -CleanupTaskNotificationSnoozeInterval = 选择提醒间隔 -CleanupNotificationTaskDescription = 关于清理Windows未使用的文件和更新的弹出通知提醒 -SoftwareDistributionTaskNotificationEvent = Windows更新缓存已成功删除 -TempTaskNotificationEvent = 临时文件文件夹已成功清理 -FolderTaskDescription = “{0}”文件夹清理 -ControlledFolderAccess = 受控文件夹访问 -ProtectedFoldersRequest = 是否启用受控文件夹访问权限并指定文件夹,由微软Defender保护其免受恶意应用程序威胁? -ProtectedFoldersListRemoved = 已被移除的文件夹 -AppControlledFolderRequest = 是否指定应用获取受控文件夹访问权限? -AllowedControlledFolderAppsRemoved = 删除了允许的应用 -DefenderExclusionFolderRequest = 是否要添加指定文件夹到微软Defender的恶意软件扫描白名单? -DefenderExclusionFoldersListRemoved = 排除的文件夹已删除 -AddDefenderExclusionFileRequest = 是否要添加指定文件到微软Defender的恶意软件扫描白名单? -DefenderExclusionFilesRemoved = 排除文件已删除 -EventViewerCustomViewName = 进程创建 -EventViewerCustomViewDescription = 进程创建和命令行审核事件 -RestartWarning = 确保重启电脑 -ErrorsLine = 行 -ErrorsFile = 文件 -ErrorsMessage = 错误/警告 -Add = 添加 -AllFilesFilter = 所有文件 (*.*)|*.* -Browse = 浏览 -Change = 更改 -DialogBoxOpening = 显示对话窗口…… -Disable = 禁用 -Enable = 启用 -EXEFilesFilter = *.exe|*.exe|所有文件 (*.*)|*.* -FolderSelect = 选择一个文件夹 -FilesWontBeMoved = 文件将不会被移动 -FourHours = 4个小时 -HalfHour = 30分钟 -Install = 安装 -Minute = 1分钟 -NoData = 无数据 -NoInternetConnection = 无网络连接 -NoResponse = 无法建立https://store.rg-adguard.net连接 -No = 否 -Yes = 是 -Open = 打开 -Patient = 请等待…… -Restore = 重置 -Run = 运行 -SelectAll = 全选 -Skip = 跳过 -Skipped = 已跳过 -TelegramTitle = 加入我们的官方电报群组 -Uninstall = 卸载 -'@ +ConvertFrom-StringData -StringData @' +UnsupportedOSBitness = 该脚本仅支持Windows 10 x64 +UnsupportedOSBuild = 该脚本支持Windows 10版本2004/20H2/21H1和更高版本 +UnsupportedISE = 该脚本不支持通过Windows PowerShell ISE运行 +UnsupportedRelease = 找到新版本 +CustomizationWarning = \n在运行Sophia Script之前,您是否已自定义Sophia.ps1预设文件中的每个函数? +ControlledFolderAccessDisabled = “受控文件夹访问”已禁用 +ScheduledTasks = 计划任务 +OneDriveUninstalling = 卸载OneDrive…… +OneDriveInstalling = OneDrive正在安装...... +OneDriveDownloading = 正在下载OneDrive...... ~33 MB +WindowsFeaturesTitle = Windows功能 +OptionalFeaturesTitle = 可选功能 +EnableHardwareVT = UEFI中开启虚拟化 +UserShellFolderNotEmpty = 一些文件留在了“{0}“文件夹。请手动将它们移到一个新位置 +RetrievingDrivesList = 取得驱动器列表…… +DriveSelect = 选择将在其根目录中创建“{0}“文件夹的驱动器 +UserFolderRequest = 是否要更改“{0}“文件夹位置? +UserFolderSelect = 为“{0}”文件夹选择一个文件夹 +UserDefaultFolder = 您想将“{0}”文件夹的位置更改为默认值吗? +ReservedStorageIsInUse = 保留存储空间正在使用时不支持此操作。请等待所有服务操作完成后再重试 +ShortcutPinning = “{0}“快捷方式将被固定到开始菜单 +UninstallUWPForAll = 对于所有用户 +UWPAppsTitle = UWP应用 +WSLUpdateDownloading = Linux内核更新包下载中…… ~14 MB +WSLUpdateInstalling = 安装Linux内核更新包…… +HEVCDownloading = Downloading 来自设备制造商的 HEVC 视频扩展... ~2,8 MB +GraphicsPerformanceTitle = 图形性能偏好 +GraphicsPerformanceRequest = 是否将所选应用程序的图形性能设置设为"高性能"? +TaskNotificationTitle = 通知 +CleanupTaskNotificationTitle = 重要信息 +CleanupTaskDescription = 使用内置磁盘清理工具清理未使用的Windows文件和更新 +CleanupTaskNotificationEventTitle = 运行任务以清理Windows未使用的文件和更新? +CleanupTaskNotificationEvent = Windows清理不会花很长时间。下次通知将在30天内显示 +CleanupTaskNotificationSnoozeInterval = 选择提醒间隔 +CleanupNotificationTaskDescription = 关于清理Windows未使用的文件和更新的弹出通知提醒 +SoftwareDistributionTaskNotificationEvent = Windows更新缓存已成功删除 +TempTaskNotificationEvent = 临时文件文件夹已成功清理 +FolderTaskDescription = “{0}”文件夹清理 +ControlledFolderAccess = 受控文件夹访问 +ProtectedFoldersRequest = 是否启用受控文件夹访问权限并指定文件夹,由微软Defender保护其免受恶意应用程序威胁? +ProtectedFoldersListRemoved = 已被移除的文件夹 +AppControlledFolderRequest = 是否指定应用获取受控文件夹访问权限? +AllowedControlledFolderAppsRemoved = 删除了允许的应用 +DefenderExclusionFolderRequest = 是否要添加指定文件夹到微软Defender的恶意软件扫描白名单? +DefenderExclusionFoldersListRemoved = 排除的文件夹已删除 +AddDefenderExclusionFileRequest = 是否要添加指定文件到微软Defender的恶意软件扫描白名单? +DefenderExclusionFilesRemoved = 排除文件已删除 +EventViewerCustomViewName = 进程创建 +EventViewerCustomViewDescription = 进程创建和命令行审核事件 +RestartWarning = 确保重启电脑 +ErrorsLine = 行 +ErrorsFile = 文件 +ErrorsMessage = 错误/警告 +Add = 添加 +AllFilesFilter = 所有文件 (*.*)|*.* +Browse = 浏览 +Change = 更改 +DialogBoxOpening = 显示对话窗口…… +Disable = 禁用 +Enable = 启用 +EXEFilesFilter = *.exe|*.exe|所有文件 (*.*)|*.* +FolderSelect = 选择一个文件夹 +FilesWontBeMoved = 文件将不会被移动 +FourHours = 4个小时 +HalfHour = 30分钟 +Install = 安装 +Minute = 1分钟 +NoData = 无数据 +NoInternetConnection = 无网络连接 +NoResponse = 无法建立https://store.rg-adguard.net连接 +No = 不 +Yes = 是的 +Open = 打开 +Patient = 请等待…… +Restore = 恢复 +Run = 运行 +SelectAll = 全选 +Skip = 跳过 +Skipped = 已跳过 +TelegramTitle = 加入我们的官方电报群组 +Uninstall = 卸载 +'@ diff --git a/Sophia/PowerShell 5.1/Manifest/Sophia.psd1 b/Sophia/PowerShell 5.1/Manifest/Sophia.psd1 index c20a37a8..721ddf2f 100644 --- a/Sophia/PowerShell 5.1/Manifest/Sophia.psd1 +++ b/Sophia/PowerShell 5.1/Manifest/Sophia.psd1 @@ -1,6 +1,6 @@ @{ RootModule = '..\Module\Sophia.psm1' - ModuleVersion = '5.10.7' + ModuleVersion = '5.10.8' GUID = '109cc881-c42b-45af-a74a-550781989d6a' Author = 'Dmitry "farag" Nefedov' Copyright = '(c) 2014–2021 farag & Inestic. All rights reserved' diff --git a/Sophia/PowerShell 5.1/Module/Sophia.psm1 b/Sophia/PowerShell 5.1/Module/Sophia.psm1 index 73b30bb4..aa719dcf 100644 --- a/Sophia/PowerShell 5.1/Module/Sophia.psm1 +++ b/Sophia/PowerShell 5.1/Module/Sophia.psm1 @@ -2,8 +2,8 @@ .SYNOPSIS "Windows 10 Sophia Script" is a PowerShell module for Windows 10 fine-tuning and automating the routine tasks - Version: v5.10.7 - Date: 13.06.2021 + Version: v5.10.8 + Date: 20.06.2021 Copyright (c) 2014–2021 farag Copyright (c) 2019–2021 farag & Inestic @@ -460,7 +460,7 @@ function WindowsFeedback ScheduledTasks -Enable .NOTES - A pop-up dialog box enables the user to select tasks + A pop-up dialog box lets a user select tasks Current user #> function ScheduledTasks @@ -2386,7 +2386,7 @@ function TaskbarSearch [Parameter( Mandatory = $true, - ParameterSetName = "ShowIcon" + ParameterSetName = "SearchIcon" )] [switch] $SearchIcon, @@ -2644,7 +2644,19 @@ function NewsInterests <# .SYNOPSIS - Unpin "Microsoft Edge" and "Microsoft Store" from the taskbar + Unpin shortcuts from the taskbar + + .PARAMETER Edge + Unpin the "Microsoft Edge" shortcut from the taskbar + + .PARAMETER Store + Unpin the "Microsoft Store" shortcut from the taskbar + + .PARAMETER Mail + Unpin the "Mail" shortcut from the taskbar + + .EXAMPLE + UnpinTaskbarShortcuts -Shortcuts Edge, Store, Mail .NOTES Current user @@ -2652,8 +2664,17 @@ function NewsInterests .LINK https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/8#issue-227159084 #> -function UnpinTaskbarEdgeStore +function UnpinTaskbarShortcuts { + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateSet("Edge", "Store", "Mail")] + [string[]] + $Shortcuts + ) + # Extract strings from shell32.dll using its' number $Signature = @{ Namespace = "WinAPI" @@ -2683,20 +2704,39 @@ public static string GetString(uint strId) # Extract the localized "Unpin from taskbar" string from shell32.dll $LocalizedString = [WinAPI.GetStr]::GetString(5387) - # Call the shortcut context menu item to unpin Microsoft Edge - if (Test-Path -Path "$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Edge.lnk") + foreach ($Shortcut in $Shortcuts) { - $Shell = New-Object -ComObject Shell.Application - $Folder = $Shell.NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar") - $Shortcut = $Folder.ParseName("Microsoft Edge.lnk") - $Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()} + switch ($Shortcut) + { + Edge + { + if (Test-Path -Path "$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Microsoft Edge.lnk") + { + # Call the shortcut context menu item + $Shell = New-Object -ComObject Shell.Application + $Folder = $Shell.NameSpace("$env:AppData\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar") + $Shortcut = $Folder.ParseName("Microsoft Edge.lnk") + $Shortcut.Verbs() | Where-Object -FilterScript {$_.Name -eq $LocalizedString} | ForEach-Object -Process {$_.DoIt()} + } + } + Store + { + # Start-Job is used due to that the calling this function before UninstallUWPApps breaks the retrieval of the localized UWP apps packages names + Start-Job -ScriptBlock { + $Apps = (New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() + ($Apps | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"}).Verbs() | Where-Object -FilterScript {$_.Name -eq $Using:LocalizedString} | ForEach-Object -Process {$_.DoIt()} + } | Receive-Job -Wait -AutoRemoveJob + } + Mail + { + # Start-Job is used due to that the calling this function before UninstallUWPApps breaks the retrieval of the localized UWP apps packages names + Start-Job -ScriptBlock { + $Apps = (New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() + ($Apps | Where-Object -FilterScript {$_.Path -eq "microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.windowslive.mail"}).Verbs() | Where-Object -FilterScript {$_.Name -eq $Using:LocalizedString} | ForEach-Object -Process {$_.DoIt()} + } | Receive-Job -Wait -AutoRemoveJob + } + } } - - # Start-Job is used due to that the calling this function before UninstallUWPApps breaks the retrieval of the localized UWP apps packages names - Start-Job -ScriptBlock { - $Apps = (New-Object -ComObject Shell.Application).NameSpace("shell:::{4234d49b-0245-4df3-b780-3893943456e1}").Items() - ($Apps | Where-Object -FilterScript {$_.Name -eq "Microsoft Store"}).Verbs() | Where-Object -FilterScript {$_.Name -eq $Using:LocalizedString} | ForEach-Object -Process {$_.DoIt()} - } | Receive-Job -Wait -AutoRemoveJob } <# @@ -3345,6 +3385,9 @@ function AppsLanguageSwitch .EXAMPLE OneDrive -Install + .NOTES + The OneDrive user folder won't be removed + .NOTES Machine-wide #> @@ -3391,9 +3434,16 @@ function OneDrive Start-Process -FilePath $OneDriveSetup[0] -ArgumentList $OneDriveSetup[1..2] -Wait } - # Getting the OneDrive user folder path and removing it + # Get the OneDrive user folder path and remove it if it doesn't contain any user filesS $OneDriveUserFolder = Get-ItemPropertyValue -Path HKCU:\Environment -Name OneDrive - Remove-Item -Path $OneDriveUserFolder -Recurse -Force -ErrorAction Ignore + if ((Get-ChildItem -Path $OneDriveUserFolder -Force -ErrorAction Ignore | Measure-Object).Count -eq 0) + { + Remove-Item -Path $OneDriveUserFolder -Recurse -Force -ErrorAction Ignore + } + else + { + Invoke-Item -Path $OneDriveUserFolder + } # https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexa # The system does not move the file until the operating system is restarted @@ -4474,7 +4524,7 @@ function WindowsManageDefaultPrinter WindowsFeatures -Enable .NOTES - A pop-up dialog box enables the user to select features + A pop-up dialog box lets a user select features Current user #> function WindowsFeatures @@ -4525,9 +4575,9 @@ function WindowsFeatures [string[]]$UncheckedFeatures = @( <# Media Features - Компоненты работы с мультимедиа - If you want to leave "Multimedia settings" in the advanced settings of Power Options do not disable this feature + + Компоненты работы с мультимедиа Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не отключайте этот компонент #> "MediaPlayback" @@ -4797,7 +4847,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); WindowsCapabilities -Install .NOTES - A pop-up dialog box enables the user to select features + A pop-up dialog box lets a user select features Current user #> function WindowsCapabilities @@ -5223,25 +5273,25 @@ function UpdateMicrosoftProducts <# .SYNOPSIS - Configure the power management scheme + Configure a power plan .PARAMETER High - Set the power management scheme on "High performance" + Set the power plan on "High performance" .PARAMETER Balanced - Set the power management scheme on "Balanced" + Set the power plan on "Balanced" .EXAMPLE - PowerManagementScheme -High + PowerPlan -High .EXAMPLE - PowerManagementScheme -Balanced + PowerPlan -Balanced .NOTES - Do not recommend turning "High performance" scheme on on laptops + It isn't recommended to turn on the "High performance" power plan on laptops Current user #> -function PowerManagementScheme +function PowerPlan { param ( @@ -8054,7 +8104,7 @@ function RunPowerShellShortcut PinToStart -Tiles ControlPanel -UnpinAll .NOTES - Separate arguments with comma + Separate arguments with a comma Current user #> function PinToStart @@ -8330,7 +8380,7 @@ public static string GetString(uint strId) UninstallUWPApps -ForAllUsers .NOTES - A pop-up dialog box enables the user to select packages + A pop-up dialog box lets a user select packages Current user #> function UninstallUWPApps @@ -8773,7 +8823,7 @@ public static extern bool SetForegroundWindow(IntPtr hWnd); UWP apps can be restored only if they were uninstalled for the current user .NOTES - A pop-up dialog box enables the user to select packages + A pop-up dialog box lets a user select packages Current user #> function RestoreUWPApps @@ -11128,7 +11178,7 @@ function CABInstallContext "Add" { # Checking whether the File Explorer is associated with the .cab files - if (-not ((Get-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.cab\UserChoice -Name ProgId -ErrorAction Ignore) -notmatch "cab")) + if (-not ((Get-ItemPropertyValue -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.cab\UserChoice -Name ProgId) -eq "CABFolder")) { # The "Install" context menu item won't be visible unless the File Explorer was assosiated with the .cab files Set-Association -ProgramPath CABFolder -Extension .cab -Icon "%SystemRoot%\system32\cabview.dll,0" diff --git a/Sophia/PowerShell 5.1/Sophia.ps1 b/Sophia/PowerShell 5.1/Sophia.ps1 index b1e9c5ee..983e0d5d 100644 --- a/Sophia/PowerShell 5.1/Sophia.ps1 +++ b/Sophia/PowerShell 5.1/Sophia.ps1 @@ -2,8 +2,8 @@ .SYNOPSIS Default preset file for "Windows 10 Sophia Script" - Version: v5.10.7 - Date: 13.06.2021 + Version: v5.10.8 + Date: 20.06.2021 Copyright (c) 2014–2021 farag Copyright (c) 2019–2021 farag & Inestic @@ -71,7 +71,7 @@ param Clear-Host -$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.10.7 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & oz-zo, 2014–2021" +$Host.UI.RawUI.WindowTitle = "Windows 10 Sophia Script v5.10.8 | Made with $([char]::ConvertFromUtf32(0x1F497)) of Windows 10 | $([char]0x00A9) farag & Inestic, 2014–2021" Remove-Module -Name Sophia -Force -ErrorAction Ignore Import-Module -Name $PSScriptRoot\Manifest\Sophia.psd1 -PassThru -Force @@ -92,7 +92,7 @@ Import-LocalizedData -BindingVariable Global:Localization -FileName Sophia -Base if ($Functions) { # Regardless of functions entered as an argument, the "Checkings" function will be executed first, - # and the "Refresh" and "Errors" functions will be executed at the end + # and the "RefreshEnvironment" and "Errors" functions will be executed at the end Invoke-Command -ScriptBlock {Checkings} foreach ($Function in $Functions) @@ -100,14 +100,14 @@ if ($Functions) Invoke-Expression -Command $Function } - Invoke-Command -ScriptBlock {Refresh; Errors} + Invoke-Command -ScriptBlock {RefreshEnvironment; Errors} exit } #region Protection <# - The necessary checkings. If you want to disable a warning message about whether you've customized the preset file remove the "-Warning" argument + The necessary checkings. If you want to disable a warning message about whether the preset file was customized, remove the "-Warning" argument Please, do not comment out this function Обязательные проверки. Чтобы выключить предупреждение о необходимости настройки пресет-файла, удалите аргумент "-Warning" @@ -448,9 +448,9 @@ NewsInterests -Hide # Отображать "Новости и интересы" на панели задач (значение по умолчанию) # NewsInterests -Show -# Unpin Microsoft Edge and Microsoft Store from the taskbar -# Открепить Microsoft Edge и Microsoft Store от панели задач -UnpinTaskbarEdgeStore +# Unpin the "Microsoft Edge", "Microsoft Store", or "Mail" shortcuts from the taskbar +# Открепить ярлыки "Microsoft Edge", "Microsoft Store" или "Почта" от панели задач +UnpinTaskbarShortcuts -Shortcuts Edge, Store, Mail # View the Control Panel icons by: large icons # Просмотр иконок Панели управления как: крупные значки @@ -546,8 +546,8 @@ AppsLanguageSwitch -Enable #endregion UI & Personalization #region OneDrive -# Uninstall OneDrive -# Удалить OneDrive +# Uninstall OneDrive. The OneDrive user folder won't be removed +# Удалить OneDrive. Папка пользователя OneDrive не будет удалена OneDrive -Uninstall # Install OneDrive (default value) @@ -667,7 +667,7 @@ WindowsManageDefaultPrinter -Disable Отключить компоненты Windows, используя всплывающее диалоговое окно If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not disable the "MediaPlayback" feature - Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не удаляйте отключайте "MediaPlayback" + Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах схемы управления питанием, не отключайте "MediaPlayback" #> WindowsFeatures -Disable @@ -677,10 +677,10 @@ WindowsFeatures -Disable <# Uninstall optional features using the pop-up dialog box - Удалить дополнительные компоненты, используя всплывающее диалоговое окно - If you want to leave "Multimedia settings" element in the advanced settings of Power Options do not uninstall the "MediaPlayback" feature - Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах электропитания, не удаляйте компонент "MediaPlayback" + + Удалить дополнительные компоненты, используя всплывающее диалоговое окно + Если вы хотите оставить параметр "Параметры мультимедиа" в дополнительных параметрах схемы управления питанием, не удаляйте компонент "MediaPlayback" #> WindowsCapabilities -Uninstall @@ -696,13 +696,18 @@ UpdateMicrosoftProducts -Enable # При обновлении Windows не получать обновления для других продуктов Майкрософт (значение по умолчанию) # UpdateMicrosoftProducts -Disable -# Set the power management scheme on "High performance" if device is a desktop -# Установить схему управления питанием на "Высокая производительность", если устройство является стационарным ПК -PowerManagementScheme -High +<# + Set the power plan on "High performance" + It isn't recommended to turn on the "High performance" power plan on laptops -# Set the power management scheme on "Balanced" (default value) + Установить схему управления питанием на "Высокая производительность" + Не рекомендуется включать схему управления питанием "Высокая производительность" для ноутбуков +#> +PowerPlan -High + +# Set the power plan on "Balanced" (default value) # Установить схему управления питанием на "Сбалансированная" (значение по умолчанию) -# PowerManagementScheme -Balanced +# PowerPlan -Balanced # Use latest installed .NET runtime for all apps # Использовать последнюю установленную среду выполнения .NET для всех приложений @@ -887,8 +892,6 @@ DeviceRestartAfterUpdate -Enable Register app, calculate hash, and set as default for specific extension without the "How do you want to open this?" pop-up Зарегистрировать приложение, вычислить хэш и установить как приложение по умолчанию для конкретного расширения без всплывающего окна "Каким образом вы хотите открыть этот файл?" - Examples: - Примеры: Set-Association -ProgramPath "C:\SumatraPDF.exe" -Extension .pdf -Icon "shell32.dll,100" Set-Association -ProgramPath "%ProgramFiles%\Notepad++\notepad++.exe" -Extension .txt -Icon "%ProgramFiles%\Notepad++\notepad++.exe,0" #> @@ -942,18 +945,16 @@ RunPowerShellShortcut -Elevated # RunPowerShellShortcut -NonElevated <# - Pin to Start the following links: Control Panel, Devices and Printers, PowerShell + Pin to Start the following shortcuts: Control Panel, Devices and Printers, PowerShell Valid shortcuts values: ControlPanel, DevicesPrinters and PowerShell - Закрепить на начальном экране следующие ярлыки: Панель управдения, Устройства и принтеры, PowerShell + Закрепить на начальном экране следующие ярлыки: Панель управления, Устройства и принтеры, PowerShell Валидные значения ярлыков: ControlPanel, DevicesPrinters, PowerShell #> PinToStart -Tiles ControlPanel, DevicesPrinters, PowerShell -<# - Unpin all tiles first and pin necessary ones - Открепить все ярлыки сначала и закрепить необходимые -#> +# Unpin all tiles first and pin necessary ones +# Открепить все ярлыки сначала и закрепить необходимые # PinToStart -UnpinAll -Tiles ControlPanel, DevicesPrinters, PowerShell # Unpin all the Start tiles