Can PSCX components be installed individually?

Topics: User Forum
May 2, 2007 at 10:35 AM
I've installed PSCX and now my Powershell windows are triggering a bunch of errors.

First error is "Update-FormatData: Cannot find path 'C:\FormatData\FileSystem.ps1xml'x` with about 15 more errors that followed. I looked at Profile.ps1 and from that tried setting PSCXHOME in my environment, but that didn't work. I soon realized that many PSCX components are tightly-coupled and that PSCX adds a lot of stuff to my Powershell environment. much that I don't want, at least not yet. While I'm sure it's cool, it creates a lot of unknowns for me and I was only interested in things like "Get-URL."

Is it possible to just install the components individually so as to minimize the amount of complexity and potential unknowns?
May 2, 2007 at 10:56 AM
Okay, I fixed the problem by adding the following line at the top of Profile.ps1:

${Env:PscxHome}= "C:\Program Files\PowerShell Community Extensions\"

Now my prompt is all screwed up. I'm guessing that it is the "eye candy" stuff, but I'd like to disable that, at least while I'm still learning Powershell. When I comment out the following line I get an error when starting Powershell:

#$PscxEyeCandyScriptPreference = '.\EyeCandy.Keith.ps1'

So the question still stands; how can I get just the components I want from PSCX to work and omit the rest, at least until I later decide to add them in?
Coordinator
May 2, 2007 at 5:20 PM
Edited May 2, 2007 at 5:21 PM
The PscxHome is supposed to get created as an environment variable during installation. This may require a reboot for the system to recognize the new env var. To use your own prompt, comment out the following line (towards the bottom of the profile script):

. $PscxEyeCandyScriptPreference

Feel free to comment any of the dot-sourced scripts that you want. If you only want the cmdlets then you can use your own profile script. Just be sure to do an Add-PSSnapin PSCX.
May 2, 2007 at 5:55 PM
Thanks Keith:

I got it working but I guess I'm still looking for a more modular design. My reasons for that is I want to understand what is being added in before I add it in. I also don't want to have to wait so long for it to start up. As someone new to Powershell, I don't want to have an environment that does this different than how it responds in books, articles, and other people's examples, at least not until I understand thoroughly what's going on under the hood.

Also, why so many global vars? Why not one global hashtable such as "PscxVars" or something?
Coordinator
May 2, 2007 at 8:31 PM
We are working on lessing the global environment impact. That is why we moved many functions from being dot sourced into scripts in 1.1. We are still working on tightening up the global impact of PSCX and I appreciate the feedback. WRT globals, that is a reasonable request. I'm not sure I would want to put every global in $PscxVars but certainly all of the__Pscx* variables could go there.
May 3, 2007 at 4:10 AM
Edited May 3, 2007 at 4:10 AM

rkeithhill wrote:
We are working on lessing the global environment impact. That is why we moved many functions from being dot sourced into scripts in 1.1.

I'm not yet familiar with the distinction between dot sourced and scripts?


We are still working on tightening up the global impact of PSCX and I appreciate the feedback.


And thanks for running the project as open-source...


WRT globals, that is a reasonable request.


Yeah, it may not be that much diffferent WRT memory or startup, But it reduces conceptual complexity and makes "Get-Variable" cleaner.


I'm not sure I would want to put every global in $PscxVars but certainly all of the__Pscx* variables could go there.


Just to help me understand the architecture, what other Globals are there? I read your instructions and in them you specified a set of conventions for variables that start with "Pscx."