If I execute this file as
.\define
the functions are defined only in the scope of the script, and so are
gone when the script finishes. If I execute the file as
. .\define
they are inserted into the function: drive, as the initial ". " allows
the script to affect execution environment.
I am interested in whether there is a simple way to do this without
using the ". " modifier on the command line, similar to using the
$global: modifier to affect the scope of variables. I realize that the
effort to type ". " before the script name is trivial; this is just for
my own curiosity.
Thanks,
Al
If you don't want to dot-source, then you have to use the $global: modifier
in the script.
AFAIK, there aren't any other options...
Marco
Definitely most reliable way is to use
Function Global:MyFunction {}
Martin
"Al Fansome" <al_fa...@hotmail.com> wrote in message
news:oJOdnTzlZLrZ4ZXW...@supernews.com...
As an alternative, why not just define these functions in a module, then
add that module to the profile (Or manually add it at run time). It's
not quite the answer you were looking for, but IMHO, possibly better.
HTH
Thomas
--
Thomas Lee
doct...@gmail.com