PowerShell Community Extensions and x64

PowerShell Community Extensions is a great addition to PowerShell that supplements the out-of-the box set of cmdlets. However, it doesn’t work out-of-the-msi on an x64 platform.

When installing, I opted to use the Shared Profile, but got the following when I tried to run PowerShell:

Windows PowerShell
Copyright (C) 2006 Microsoft Corporation. All rights reserved.
Add-PSSnapin : Windows PowerShell snap-in Pscx is not installed on the machine.
At C:\Documents and Settings\Mark\MyDocs\WindowsPowerShell\profile.ps1:38 char:13
+ Add-PSSnapin <<<< Pscx

Transcript started, output file is C:\Documents and Settings\Mark\MyDocs\WindowsPowerShell\Transcripts\20070102.1
43613.7364.txt
[C:\Documents and Settings\Mark]
1> Get-PSSnapin
Name : Microsoft.PowerShell.Core
PSVersion : 1.0
Description : This Windows PowerShell snap-in contains Windows PowerShell management cmdlets used to manage components
of Windows PowerShell.
Name : Microsoft.PowerShell.Host
PSVersion : 1.0
Description : This Windows PowerShell snap-in contains cmdlets used by the Windows PowerShell host.
Name : Microsoft.PowerShell.Management
PSVersion : 1.0
Description : This Windows PowerShell snap-in contains management cmdlets used to manage Windows components.

Name : Microsoft.PowerShell.Security
PSVersion : 1.0
Description : This Windows PowerShell snap-in contains cmdlets to manage Windows PowerShell security.

Name : Microsoft.PowerShell.Utility
PSVersion : 1.0
Description : This Windows PowerShell snap-in contains utility Cmdlets used to manipulate data.

[C:\Documents and Settings\Mark]
2> Get-PSSnapin -Registered

Name : PowerGadgets
PSVersion : 1.0
Description : Generates Charts, Gauges and Maps Gadgets from Windows PowerShell data

Well the snap-in isn’t registered on my system, let’s try PowerShell (32bit):

Windows PowerShell
Copyright (C) 2006 Microsoft Corporation. All rights reserved.
Transcript started, output file is C:\Documents and Settings\Mark\MyDocs\WindowsPowerShell\Transcripts\20070102.1
44524.1412.txt
[C:\Documents and Settings\Mark]
1> Get-PSSnapin pscx
Name : Pscx
PSVersion : 1.0
Description : PowerShell Community Extensions (PSCX) base snapin which implements a general purpose set of cmdlets.

Works with no troubles.

Fortunately this is easy to fix, the installer used for Pscx is a 32bit process and doesn’t invoke the 64bit version of InstallUtil.exe to register the snap-in for 64bit processes. Just run the following from your favourite shell:

[C:\Documents and Settings\Mark]
1> C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe “C:\Program Files (x86)\PowerShell Community Extensions\InstallerCustomAction.dll”
[C:\Documents and Settings\Mark]
2> C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe “C:\Program Files (x86)\PowerShell Community Extensions\pscx.dll”
Restart PowerShell and everything is good for both 32bit and 64bit PowerShell :)

I have raised this as an issue on site. Hopefully they’ll fix it on the next release.

One Response to “PowerShell Community Extensions and x64”

  1. I have to say, that I could not agree with you in 100% regarding PowerShell Community Extensions and x64, but it’s just my opinion, which could be wrong :)

Leave a Reply