From 197116b2bb1f94400cc2a1e921cd72a927877ee2 Mon Sep 17 00:00:00 2001 From: farag2 Date: Thu, 29 Aug 2019 09:16:49 +0300 Subject: [PATCH] 29.08.2019 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed loop in "Set "High performance" in graphics performance preference for apps" Исправлен бесконечный цикл в разделе "Установить параметры производительности графики для отдельных приложений на "Высокая производительность"" --- Win 10.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Win 10.ps1 b/Win 10.ps1 index 0a404c42..8b850cdc 100644 --- a/Win 10.ps1 +++ b/Win 10.ps1 @@ -1642,6 +1642,7 @@ IF ((Get-CimInstance -ClassName Win32_ComputerSystem).PCSystemType -ne 2 -and (G [Parameter(Mandatory = $True)] [string[]]$apps ) + $apps = $apps.Replace("`"", "").Split(",").Trim() foreach ($app in $apps) { New-ItemProperty -Path HKCU:\Software\Microsoft\DirectX\UserGpuPreferences -Name $app -Type String -Value "GpuPreference=2;" -Force @@ -1650,12 +1651,11 @@ IF ((Get-CimInstance -ClassName Win32_ComputerSystem).PCSystemType -ne 2 -and (G Do { $apps = Read-Host -Prompt " " - IF ($app -match ".exe" -and $app -match "`"") + IF ($apps -match ".exe" -and $apps -match "`"") { - $apps = $apps.Replace("`"", "").Split(",").Trim() GpuPreference $apps } - elseif ([string]::IsNullOrEmpty($app)) + elseif ([string]::IsNullOrEmpty($apps)) { break } @@ -1675,7 +1675,7 @@ IF ((Get-CimInstance -ClassName Win32_ComputerSystem).PCSystemType -ne 2 -and (G } } } - Until ($app -match ".exe" -and $app -match "`"") + Until ($apps -match ".exe" -and $apps -match "`"") } # Automatically adjust active hours for me based on daily usage # Автоматически изменять период активности для этого устройства на основе действий