PSCX with Server 2008 X64

Topics: Developer Forum, User Forum
Apr 3, 2009 at 3:56 PM
Edited Apr 3, 2009 at 3:59 PM
Is there any help/description or anything on how to install the PSCX?  What it's compatible with?  How to troublshoot any install problems?  Anything that explains how your shell will be altered (other than having additional cmdlets) once it's installed?

Silly me.  I trusted the very brief Readme when it said:
Just start up your Windows PowerShell prompt and execute the following [...]
The install didn't give me any errors, and I allowed the profile (since I didn't have more than a one-line test profile anyway) to be created for me.  When I open up a console window now though, I get:

    Add-PSSnapin : Windows PowerShell snap-in Pscx is not installed on the machine.
    At C:\Users\casper\Documents\WindowsPowerShell\profile.ps1:98 char:14
    +     Add-PSSnapin  <<<< Pscx
    The term 'Start-TabExpansion' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.

and after a few more errors, I end up with a "1#" for a prompt (with the number incrementing with each command).  Help annoyingly opens into "less" which I've been ctrl-C'ing out of, but then can't see the syntax for the cmdlet I'm trying to use.  I know I can just remove/rename the profile.ps1 file and be back to where I was, but I would like to use some of the PSCX cmdlets while learning/experimenting with PowerShell. 

<rant>I would like to try a few other snappins, but frustratingly there is little information on how to get any of them installed.  Once they are installed (and registered), adding them to the shell is well documented, but this is like driving from point A to point B - easy to do with a map unless you don't know how to drive!</rant>

Apr 4, 2009 at 9:13 PM
You should be able to run PSCX from a PowerShell x86 console with no issues.  As for getting it to run on the 64-bit version of PowerShell to load the snapin, you have to register the snapin manually like so from a 64-bit shell running with admin privileges:

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe /i "C:\Program Files (x86)\PowerShell Community Extensions\pscx.dll"

The majority of the cmdlets should work on x64 but there are a few known issues like Get-PEHeader and Test-Assembly that don't work on x64. 

FWIW V2 is going to make "install" much better with the new Modules support.  These require no installation.  Just xcopy them into your WindowsPowerShell\Modules directory and then you just execute:

Import-Module PSCX

WRT to less.exe, you can bypass by it by executing "Get-Help <command> | more".  We'll look at making this configurable in a future version.

Apr 20, 2009 at 2:14 AM
Thanks for the instructions for 64-bit machines.  Your instructions worked for me.

Import-Module already works in CTP 3, right?  For .dll modules, omit the extension when supplying Import-Module with its argument, right?  What is the difference between Import-Module and Add-Module?

Apr 21, 2009 at 4:51 AM
No difference between add-module and import-module; add-module was the name used in CTP2. In CTP3, it was renamed to use the import verb to better fit in with export-modulemember cmdlet.