From a7f866167bbf1adc2b1baffaaaf7518620694fbb Mon Sep 17 00:00:00 2001 From: farag2 Date: Tue, 12 Feb 2019 13:28:18 +0300 Subject: [PATCH] Update Win 10.ps1 --- Win 10.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Win 10.ps1 b/Win 10.ps1 index 2a3de41a..cd0717d8 100644 --- a/Win 10.ps1 +++ b/Win 10.ps1 @@ -370,7 +370,7 @@ Register-ScheduledTask @Params -Force $xml = 'Программы\Прочее\xml\SoftwareDistribution.xml' filter Get-FirstResolvedPath { - (Get-Disk | Where-Object {$_.BusType -eq "USB"} | Get-Partition | Get-Volume | Where-Object {$_.DriveLetter -ne $null}).DriveLetter + ':\' | Join-Path -ChildPath $_ -Resolve -ErrorAction SilentlyContinue + (Get-Disk | Where-Object {$_.BusType -eq "USB"} | Get-Partition | Get-Volume | Where-Object {$null -ne $_.DriveLetter}).DriveLetter + ':\' | Join-Path -ChildPath $_ -Resolve -ErrorAction SilentlyContinue } $xml | Get-FirstResolvedPath | Get-Item | Get-Content -Raw | Register-ScheduledTask -TaskName "SoftwareDistribution" -Force # Включить в Планировщике задач очистки папки %SYSTEMROOT%\Logs\CBS @@ -467,7 +467,7 @@ New-ItemProperty -Path HKCU:\Software\Policies\Microsoft\Windows\CloudContent -N $drives = Get-Disk | Where-Object {$_.IsBoot -eq $false} IF ($drives) { - $drives = ($drives | Get-Partition | Get-Volume | Where-Object {$_.DriveLetter -ne $null}).DriveLetter + ':' + $drives = ($drives | Get-Partition | Get-Volume | Where-Object {$null -ne $_.DriveLetter}).DriveLetter + ':' Foreach ($drive In $drives) { Set-MpPreference -ExclusionPath $drive\Программы\Прочее -Force