header image

Passing function names

Posted by: | January 16, 2013 | No Comment |

A question asked about passing a function name into another function which then called the function. It sounds worse than it is. if you need to pass the name of a command and then call it try using invoke-expression

function ffour {            
function fthree {            
function ftwo {            
Invoke-Expression $fname            
ftwo fthree            
ftwo ffour
under: PowerShell Basics