From a93cba8c8e9ba64b13d345db655b954f9859ed30 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Tue, 24 Aug 2021 23:59:10 +0300 Subject: [PATCH] Update Sophia.psm1 --- Sophia/LTSC/Module/Sophia.psm1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sophia/LTSC/Module/Sophia.psm1 b/Sophia/LTSC/Module/Sophia.psm1 index 3de38f45..cc0a4a87 100644 --- a/Sophia/LTSC/Module/Sophia.psm1 +++ b/Sophia/LTSC/Module/Sophia.psm1 @@ -9156,13 +9156,13 @@ function Errors { if ($Global:Error) { - # Some errors may have the Windows nature and don't have a path to any of the module's files - $ErrorInFile = if ($_.InvocationInfo.PSCommandPath) - { - Split-Path -Path $_.InvocationInfo.PSCommandPath -Leaf - } - ($Global:Error | ForEach-Object -Process { + # Some errors may have the Windows nature and don't have a path to any of the module's files + $ErrorInFile = if ($_.InvocationInfo.PSCommandPath) + { + Split-Path -Path $_.InvocationInfo.PSCommandPath -Leaf + } + [PSCustomObject]@{ $Localization.ErrorsLine = $_.InvocationInfo.ScriptLineNumber $Localization.ErrorsFile = $ErrorInFile