VMware Cloud Community
fordian
Hot Shot
Hot Shot

How to call an external functions

Hi,

How can I call external functions (functions.ps1) from another ps script (test.ps1) ?

Thank you

Dominic

0 Kudos
2 Replies
LucD
Leadership
Leadership

You can dot-source the script

. .\functions.ps1

(That is a dot followed by a space, followed by the path to the .ps 1file)

And now you can call the function in functions.ps1 by name


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
fordian
Hot Shot
Hot Shot

I forgot the space after the dot Smiley Sad

Thank you for your help

0 Kudos