From 51c34b515f7b7f7fe5ed7c913187c3703d9a2f5e Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 8 Nov 2018 14:10:29 +0300 Subject: [PATCH] Update Win 10.ps1 --- Win 10.ps1 | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/Win 10.ps1 b/Win 10.ps1 index f2df3fcb..7dc9e5be 100644 --- a/Win 10.ps1 +++ b/Win 10.ps1 @@ -1,4 +1,4 @@ -# Службы диагностического отслеживания +# Службы диагностического отслеживания $services = @( "CDPSvc", "DiagTrack", @@ -223,8 +223,8 @@ IF (!(Test-Path $env:SystemDrive\Temp)) [Environment]::SetEnvironmentVariable("TMP","$env:SystemDrive\Temp","Machine") [Environment]::SetEnvironmentVariable("TEMP","$env:SystemDrive\Temp","Machine") # Удаление UWP-приложений -Get-AppxPackage -AllUsers | Where-Object name -CNotLike *Store* | Remove-AppxPackage -ErrorAction SilentlyContinue -Get-AppxProvisionedPackage -Online | Where-Object DisplayName -CNotLike *Store* | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue +Get-AppxPackage -AllUsers | Where-Object {$_.Name -CNotLike "*Store*" -and $_.Name -CNotLike "Microsoft.LanguageExperiencePackru-ru"} | Remove-AppxPackage -ErrorAction SilentlyContinue +Get-AppxProvisionedPackage -Online | Where-Object {$_.DisplayName -CNotLike "*Store*" -and $_.Name -CNotLike "Microsoft.LanguageExperiencePackru-ru"} | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue # Отключение компонентов $features = @( # Отключение службы "Факсы и сканирование" @@ -371,22 +371,6 @@ $params = @{ Register-ScheduledTask @Params -Force #> # Включение в Планировщике задач удаление устаревших обновлений Office -$drives = (Get-Disk | Where-Object BusType -ne USB | Get-Partition | Where-Object IsBoot -ne True | Get-Volume).DriveLetter | ForEach-Object {$_ + ':'} | Join-Path -ChildPath $_ -Resolve -ErrorAction SilentlyContinue -IF ($drives) -{ - IF (!(Test-Path D:\Программы\Прочее)) - { - New-Item -ItemType Directory D:\Программы\Прочее -Force - } - $bat = 'Программы\Прочее\Office_task.bat' - $xml = 'Программы\Прочее\xml\Office.xml' - filter Get-FirstResolvedPath - { - (Get-Disk | Where-Object BusType -eq USB | Get-Partition | Get-Volume).DriveLetter | ForEach-Object {$_ + ':\'} | Join-Path -ChildPath $_ -Resolve -ErrorAction SilentlyContinue | Select-Object -First 1 - } - $bat | Get-FirstResolvedPath | Copy-Item -Destination D:\Программы\Прочее -Force - $xml | Get-FirstResolvedPath | Get-Item | Get-Content -Raw | Register-ScheduledTask -TaskName "Office" -Force -} <# $action = New-ScheduledTaskAction -Execute "Powershell.exe" -Argument @" `$getservice = Get-Service -Name wuauserv