From ec8725ccad9e00d63c0ad90f02479ab03201a53b Mon Sep 17 00:00:00 2001 From: farag2 Date: Fri, 21 Jun 2019 11:48:14 +0300 Subject: [PATCH] 21.06.2019 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added section with error output after executing the script. Добавлен раздел с выводом ошибок после выполнения скрипта. --- Win 10.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Win 10.ps1 b/Win 10.ps1 index 2385ba90..7d422244 100644 --- a/Win 10.ps1 +++ b/Win 10.ps1 @@ -1178,3 +1178,13 @@ Stop-Process -Name StartMenuExperienceHost -Force # Restart File Explorer # Перезапустить "File Explorer" Stop-Process -Name explorer -Force +# Errors output +# Вывод ошибок +Write-Output "" +Write-Host Errors -BackgroundColor Red +($Error | Where-Object -FilterScript {$_ -notmatch "HRESULT" -and $_ -notmatch "TaskManager"} | ForEach-Object { + [PSCustomObject] @{ + Line = $_.InvocationInfo.ScriptLineNumber + Error = $_.Exception.Message + } +} | Format-Table -AutoSize -Wrap | Out-String).Trim()