From 1fef4aeef119050a4cc8a3d0856fedfe61f07841 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Tue, 24 Aug 2021 23:59:50 +0300 Subject: [PATCH] Update Sophia.psm1 --- Sophia/PowerShell 7/Module/Sophia.psm1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sophia/PowerShell 7/Module/Sophia.psm1 b/Sophia/PowerShell 7/Module/Sophia.psm1 index ace7e4f2..6cb97303 100644 --- a/Sophia/PowerShell 7/Module/Sophia.psm1 +++ b/Sophia/PowerShell 7/Module/Sophia.psm1 @@ -12477,13 +12477,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