Fixes to PowerShell Community Extension 1.1.1
I’ve been using the Community Extensions for PowerShell for some time now but for various reasons haven’t had the time to really dive in and learn it (or PowerShell) the way I’d like. My company (well, the IT department at my company) is now standardizing on using PowerShell in place of cmd.exe and using the community extensions. In the process I found a couple glitches with it that I wanted to share with the community (that would be you).
Bug in CD
There is a bug in the CD command that causes the new location to always be displayed. It has apparently been fixed in the forth-coming 1.2 release. Here is what you need to do to fix it in the current release.
- In the
$Env:ProgramFiles\PowerShell Community Extensionsfolder edit thecd.ps1script. - On line 202, change the check from:
if (!$PassThru) { (Get-Location).ProviderPath }
to
if ($PassThru) { (Get-Location).ProviderPath } - Restart PowerShell.
Using a shared profile
We are planning to write shared profile scripts that everyone executes which will include the default PSCX profile script. Here are some problems I found with doing this.
- The script expects you to edit it to specify the EyeCandy script to execute. My suggestion to the PSCX developers was to not execute any script or allow it to be bypassed. I had to edit the profile script to comment this code out.
- The script sets the ProfileDir and UserProfile variables based on the location of the script. In our case, this is in a directory that is managed by source control. I ended up removing those variables and redefining them in our company-specific profile script. I suggested that the PSCX developers define them based on the value of the $profile variable, which is what I do. Hopefully they will do that in the upcoming release.
Resources
You can read my previous article on the Community Extensions and my series on PowerShell here:
- PowerShell Community Extensions
- Getting PowerShell (first in a series of PowerShell how-to articles)




October 7th, 2008 at 7:57 pm
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. Please post something on the discussion forums at