If I have a .ps1 file with the following functions
function SomeFunction {}
function AnotherFunction {}
How can I get a list of all those functions and invoke them?
I'd like to do something like this:
$functionsFromFile = Get-ListOfFunctions -Path 'C:someScript.ps1'
foreach($function in $functionsFromFile)
{
$function.Run() #SomeFunction and AnotherFunction execute
}
See Question&Answers more detail:os