Simple references are okay. $PSScriptRoot for example. I haven't tested more complicated references. Example: "$(Split-Path -Path $($frame.ScriptName) -Leaf):$($frame.ScriptLineNumber):" Example: "$ErrorPSItem.InvocationInfo.ScriptLineNumber"