19
2
I've defined a dynamic function in powershell, like this:
> function test { dir -r -fil *.vbproj | ft directory, name }
Then I can just type test
and run that function, piping it to other commands, etc. Pretty handy.
Is there a way I can get the definition of the command? Can I echo out the code for my function test
? (Without having to go back through my history to where I defined it?)
1In
$profile
function def ($funcname) { (Get-Command $funcname).Definition }
– Kolob Canyon – 2017-02-21T22:33:32.067