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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…