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