PSColor icon indicating copy to clipboard operation
PSColor copied to clipboard

Cannot load module on PowerShell Core 6.2.3 on Ubuntu

Open sba923 opened this issue 5 years ago • 3 comments

This should speak for itself:

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.2.3
PSEdition                      Core
GitCommitId                    6.2.3
OS                             Linux 4.15.0-72-generic #81-Ubuntu SMP Tue Nov 26 12:20:02 UTC 2019
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

> import-module -Verbose PSColor
VERBOSE: Skipping the Version folder 1.0.0.0 under Module /home/sto/.local/share/powershell/Modules/PSColor as it does not have a valid module manifest file.
import-module : The specified module 'PSColor' was not loaded because no valid module file was found in any module directory.
At line:1 char:1
+ import-module -Verbose PSColor
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ResourceUnavailable: (PSColor:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

> ls -l /home/sto/.local/share/powershell/Modules/PSColor/1.0.0.0/
total 48
-rw-rw-r-- 1 sto sto  2879 Mar  2  2016 FileInfo.ps1
-rw-rw-r-- 1 sto sto   560 Mar  2  2016 MatchInfo.ps1
-rw-rw-r-- 1 sto sto  1065 Mar  2  2016 ProcessInfo.ps1
-rw-rw-r-- 1 sto sto 11259 Mar  2  2016 PSColorHelper.ps1
-rw-rw-r-- 1 sto sto  5306 Mar  2  2016 PsColor.psd1
-rw-rw-r-- 1 sto sto  1702 Mar  2  2016 PSColor.psm1
-rw-rw-r-- 1 sto sto  6174 Dec 24 09:53 PSGetModuleInfo.xml
-rw-rw-r-- 1 sto sto   960 Mar  2  2016 ServiceController.ps1

sba923 avatar Dec 24 '19 09:12 sba923

Just in case it doesnt speak for itself; the file PsColor.psd1 has a lowercase s and renaming the file to PSColor.psd1 fixes it.

emptyother avatar Dec 31 '19 01:12 emptyother

Indeed! Shame on me for not detecting that when pasting the ls -l output...

At least, the fix to be included in the next release is an easy one. I might even try to find some bandwidth to create the corresponding PR...

sba923 avatar Jan 05 '20 17:01 sba923

I run into the same problem

rapha8l avatar Dec 09 '21 08:12 rapha8l