You just need to "dot" the script. Put a period in front of the script name
when executing, similar to the UNIX shells. (space between the period and the
script name).
PS>. ./goodbye.ps1
"JeremyG" wrote:
> I think i'm missing something big. I'm hoping that the answer is simple, if
> not I'm going to be very dismayed with powershell.
>
> I want to run scripts that setup my current working environment with
> variables, objects and functions. This way I can start a new power-shell,
> run a script and be at a useful state immediately.
>
> In the most simplest form, i want to run this "goodbye.ps1" script:
> $x = "Goodbye World"
>
> Then at the command line, I want to have this effective outcome:
>
> PS> $x
> PS> ./goodbye.ps1
> PS> $x
> Goodbye World
>
> Obviously the ability to do this would be awesome. If this is possible I
> can write a script that would create Active Directory objects, pre-set arrays
> or XML files. Then work with them free-form depending on what i need to do.
>
> Help!