【发布时间】:2011-01-26 14:03:35
【问题描述】:
我想做这样的事情......
try
{
# Something in this function throws an exception
Backup-Server ...
}catch
{
# Capture stack trace of where the error was thrown from
Log-Error $error
}
理想情况下,我想捕获函数的参数和行号等(就像您在 get-pscallstack 中看到的那样)
编辑:澄清一下,这是我想要的不是 .NET 的 powershell 堆栈跟踪
任何想法如何实现这一目标?
戴夫
【问题讨论】:
标签: powershell error-handling callstack