function Get-ParentFunctionName { <# .SYNOPSIS Get the name of the function that called this one #> [CmdletBinding()] [OutputType([System.String])] Param() return (Get-PSCallStack)[1].Command }