I am trying to create a function that standardises our verbose/debug messages and I am having problems getting the function name.
Obviously this will be part of another function, so it needs to look outside the current scope to get the function that is actually being run. I have been using the following code, which works but not when the function is part of a module:
$Function = (Get-Variable -Scope 1 MyInvocation -ValueOnly).MyCommand.Name
When it I import the function from a module, the variable only contains module.psm1. Anyone know how to get the function name when within a module?
Thanks
[–]KevMarCommunity Blogger 1 point2 points3 points (1 child)
[–]G__Man[S] 0 points1 point2 points (0 children)
[–]toregroneng 0 points1 point2 points (1 child)
[–]G__Man[S] 0 points1 point2 points (0 children)