How do I install the PowerShell Community Extensions (PSCX)
Sebastian Wright
I'm on Windows 8.1, and fairly new to Windows-side development. I've had PSCX suggested to me, but for the life of me, I can't figure out how to install PSCX 3.1 on Windows 8.1 and make the cmdlets work when I type them. (To put it frankly.)
I've downloaded and run the .msi for 3.1 from the website; as far as I can tell, it ran successfully and exited. However, running, for instance, Expand-Archive, fails.
Get-Module -ListAvailable doesn't show anything about PSCX. I checked my WindowsPowerShell directory (in C:\Users\ELLIOTTCABLE\Documents\WindowsPowerShell), there's no Modules directory in there. Just my PS1 profile.
Where, if anywhere, has the .msi installed this; and how do I get PowerShell to recognize it? (My setup is very generic, nothing strange going on on my end afaict. Again, new to Windows.)
3 Answers
After upgrading to Windows 8.1 from 7 (via 8.0) I found the same issue.
However it turns out Pscx is installed here: C:\Program Files (x86)\PowerShell Community Extensions\Pscx3\Pscx\ (in my case as I've got Pscx 3.1 installed now).
And there's a PSModulePath environment variable that points to C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
The environment variable just needs to be updated to add the path to Pscx. I guess either something reset the path on upgrade or moved Pscx out of the system32 location.
See also
I also had experienced this issue after installing the latest 3.2 version. However, I was able to get over the issue by following these steps:
- copy the "Pscx" folder located in "C:\Program Files (x86)\PowerShell Community Extensions\Pscx3".
- Paste this folder in the $PSHome location (usually it is: "C:\Windows\System32\WindowsPowerShell\v1.0\Modules").
- Run Import-Module Pscx
- You are done! Just run an example command to verify if its working (e.g. [hex] 5123123).
PSCX is available as a zip and all you have to do is copy the contents of the zip file to your modules folder $PSHome\Modules. You can then import it for use using import-module pscx
To find out where these paths are, you can use Write-Host $PSHome