I'm running Windows 7 with PowerShell 2 installed.
I've downloaded version 2.1 from here - http://pscx.codeplex.com/releases
The Release notes say
I was unsure what $env:Home was so a bit of searching determined that the release notes are expecting an environment variable called Home which doesn't exist on my machine.
A bit more searching says use what is defined as ~
on my machine. So in a PS prompt I run cd ~
Which on my machine led to a network drive U:
I created the following directories U:\Documents\WindowsPowerShell\Modules
and copied the extracted Pscx-2.1.0 to the Modules folder. Opened a PowerShell prompt and typed Get-Module -ListAvailable
. This didn't give me Pscx in the results.
The above steps actually gave me this folder tree U:\Documents\WindowsPowerShell\Modules\Pscx-2.1.0\Pscx-2.1.0
So I copied the files up a level and tried again with U:\Documents\WindowsPowerShell\Modules\Pscx-2.1.0\
and also tried with U:\Documents\WindowsPowerShell\Modules\Pscx\
I also tried all of the above with this path U:\WindowsPowerShell\Modules\Pscx-2.1.0\
I'm guessing that the Modules aren't actually supposed to be in this directory, so a bit more searching leads to this command. (Get-ChildItem Env:\PSModulePath).Value
which gives the following result
C:\Users\my.name\Documents\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
So I copy the Pscx-2.1.0 folder to here C:\Users\my.name\Documents\WindowsPowerShell\Modules\Pscx-2.1.0
And still no luck.
What step am I missing?
To install PowerShell modules manually, you first need to determine your current PowerShell module directory path, download your new module to that path, and invoke the import-module command to let windows know it's there.
To manually install the latest version of the PowerShell module, there are two methods. Use the -RequiredVersion parameter if you know the latest version of the module. Use the -MinimumVersion parameter if you know the minor version of the module and it will pick up the latest version.
PowerShell Community Extensions (PSCX) base module which implements a general purpose set of Cmdlets.
I hadn't actually completed the last step of my above question completely which turned out to be the answer.
Here is that answer for completeness
Pscx-2.1.0/Pscx-2.1.0/{lots of files}
Pscx-2.1.0/Pscx/{lots of files}
(Get-ChildItem Env:\PSModulePath).Value
and note the modules folder location.Pscx folder
to the Modules folder location given above.In PowerShell 5.0, you can do:
Find-Package pscx | ? ProviderName -eq PSModule | Install-Package -Force
The -Force
parameter will cause it to upgrade if an older version is already installed.
In PowerShell 5.1, you'll need:
Find-Package pscx | ? ProviderName -eq PowerShellGet | Install-Package -Force
or
Find-Package pscx -ProviderName PowerShellGet | Install-Package -Force
or just
Install-Package pscx -Force
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With