Get call stack inside binary cmdlet

I am writing a PowerShell binary cmdlet in C# and trying to get the current call stack.

Looking at the internals of the Get-PSCallStack cmdlet, I can see they access an internal member (this.Context) that is not available to me:

  [Cmdlet("Get", "PSCallStack", HelpUri = "")]
  [OutputType(typeof (CallStackFrame))]
  public class GetPSCallStackCommand : PSCmdlet
    protected override void ProcessRecord()
      foreach (object call in this.Context.Debugger.GetCallStack())

I am trying to figure out the name of the caller’s Command and ScriptName properties.

Anyone know how to do this?