I have a script called x.ps1 which contains a function called Parent. This function calls another function called Child (which is located in a separate module).
In the Child function I want to retrieve the name of the script and the name of the parent function.
I can get the script name (Get-ChildItem $MyInvocation.PSCommandPath | Select -Expand Name).
I cannot find out how to get the name of the parent function from within the child function.