Shared profiles

Topics: User Forum
Oct 7, 2008 at 3:50 AM
At my company we are standardizing on using PowerShell Community Extensions with virtuall the same settings for everyone.  Our solution is to check in the default PSCX profile script and then to call it from the profile script in the WindowsPowerShell directory.  My goal is to make as few changes as possible (preferably 0) to the default PSCX profile script so that when it comes time to upgrade it can be done very simply.  I've run into a few problems with this, however.
  1. The EyeCandy.Keith.ps1 script is executed by default.  It would be better (for us) if no EyeCandy script was executed by default, or to provide a way to turn off the default execution of an EyeCandy script without having to modify the file.
  2. The ProfileDir and UserProfile variables are set from the path containing the PSCX profile script.  This makes sense when the profile script resides in the profile directory.  However, since we are checking this in to a source control system and executing it from there, it resides in a different directory.  My suggestion would be to define the ProfileDir variable this way:

    (Split-Path $profile -Parent)

    Doing that will cause the UserProfile variable to be defined correctly.  My solution for now is to redefine the ProfileDir and UserProfile variables in our company-specific script.

There may be other places where it is assumed that the script resides in the profile directory.  Whenever possible, it would be great if these could be changed as well.  Another suggestion I would make is to use proper casing of commands (e.g. Split-Path instead of split-path) in the profile script.  It's not a big deal, but the script is used as an example for learning PowerShell.  It looks like in general the script does do this but there are a few places where it doesn (e.g. in the definition of variables).

Thanks for the great work on these extensions.  I'm really impressed with what is avaialble here.

David

Coordinator
Oct 8, 2008 at 4:01 AM
David, I commented on your blog post but I'll repeat it here:

David, thanks for your support.  When we first released PSCX a lot of PowerShell users didn't even know how to take advantage of profiles.  A lot has changed since then.  We realize that at this stage of PowerShell's development the default PSCX profile is over the top.  We need to provide more granular control over what gets added to existing profiles - if anything beyond loading the PSCX snapin.  If you or anybody else has suggestions we'd like to hear them.