From b8f6e6fb4ab24291141c23958910ace35cd59fba Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Wed, 25 Aug 2021 00:00:07 +0300 Subject: [PATCH] Update Sophia.psm1 --- Sophia/Windows 11/Module/Sophia.psm1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sophia/Windows 11/Module/Sophia.psm1 b/Sophia/Windows 11/Module/Sophia.psm1 index 74b1ce53..fe515f75 100644 --- a/Sophia/Windows 11/Module/Sophia.psm1 +++ b/Sophia/Windows 11/Module/Sophia.psm1 @@ -11815,13 +11815,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