function Get-ParentExecutionName { <# .SYNOPSIS Get the name of the parent executing function #> [CmdletBinding()] Param() return (Get-Variable MyInvocation -Scope 2).Value.MyCommand.Name }