You're accepting $Test as a [ScriptBlock] and then trying to use $test.File in the phoney stacktrace.
Should probably just use $Exception.ScriptStackTrace or call Get-PSCallStack or something.
The result is that any time there's an exception, the error printed says "at line: $line in " with no file name.
You're accepting $Test as a [ScriptBlock] and then trying to use $test.File in the phoney stacktrace.
Should probably just use $Exception.ScriptStackTrace or call Get-PSCallStack or something.
The result is that any time there's an exception, the error printed says "at line: $line in " with no file name.