PSCX profile scripts don't work unless called from PS profile script

Topics: User Forum
Oct 2, 2009 at 8:47 PM
Edited Oct 2, 2009 at 8:51 PM

I'm in the process of converting my company's environment over to use PSCX v1.2.  I really like the Pscx: PS drive for all the PSCX settings.

My process for converting our scripts over to PSCX v1.2 has been to execute everything from the command line instead of from the profile script, and I've been beating my head against a wal trying to understand why it doesn't work.  It finally hit me - the definitions are treated as global when run from a profile script but not from the command line, and most of the definitions in the scripts in $Pscx:ProfileDir are not explicitly labeled as global.

Just thought I'd post that up here in case someone else runs into this.  Is there a reason this was done?  I'd prefer all the definitions in the PSCX profile scripts to be explicitly global as we have some people that prefer to load some definitions manually.


Oct 3, 2009 at 5:51 PM

When you run them from the command line make sure you are dot sourcing the scripts so they affect the global scope.