Rather than creating several scripts each with one function, I have one script with has several functions.... I would like to call the script and select the function i want to use from the command line.
so far, if i change directory to that of the script i can call the function by doing this:
cd c:\myscripts
. .\mytestscript.ps1; myfunction
this works fine.... i have also tried, what I would like to achieve is calling it like this
c:\myscripts\mytestscript.ps1; myfunction
however, i am trying to run this as part of an MDT task sequence, my command line looks like this and using the ; myfunction at the end doesn't work.
powershell.exe -ExecutionPolicy Bypass %SCRIPTROOT%\CustomScripts\mytestscript.ps1; myfunction
how can i adapt my command line so that it will successfully call the function within my script?
thanks
Steve