Repository navigation
Closed
Labels
Category-ModulePertaining to the module's functionality itself.Issue-DiscussionLet's talk about it!status: stale
Description
Describe "Module Bug or Issue"
Identical to the issue reported in #452
Context "The Problem"
After following the repo-based installation steps and running Show-Karma, I receive the following error:
PS C:\code\PSKoans> Show-Karma
Show-Karma : The 'Show-Karma' command was found in the module 'PSKoans', but the module could not be loaded. For more
information, run 'Import-Module PSKoans'.
At line:1 char:1
+ Show-Karma
+ ~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Show-Karma:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
Running Import-Module PSKoans as suggested in the first error message:
PS C:\code\PSKoans> Import-Module PSKoans
Import-Module : The member 'FormatsToProcess' in the module manifest is not valid: Cannot find path
'C:\code\PSKoans\PSKoans\PSKoans.format.ps1xml' because it does not exist.. Verify that a valid value is specified for
this field in the 'C:\code\PSKoans\PSKoans\PSKoans.psd1' file.
At line:1 char:1
+ Import-Module PSKoans
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (C:\code\PSKoans\PSKoans\PSKoans.psd1:String) [Import-Module], Argu
mentException
+ FullyQualifiedErrorId : Modules_InvalidManifest,Microsoft.PowerShell.Commands.ImportModuleCommand
Installing EZOut using -AllowClobber and running PSKoans.ezformat.ps1 as suggested in #452:
PS C:\code\PSKoans> Install-Module EZOut -AllowClobber
PS C:\code\PSKoans> .\PSKoans.ezformat.ps1
PS C:\code\PSKoans>
Running Show-Karma again:
PS C:\code\PSKoans> Show-Karma
Show-Karma : You cannot call a method on a null-valued expression.
At line:1 char:1
+ Show-Karma
+ ~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Show-Karma], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull,Show-Karma
Checking $Error[0].Exception.GetBaseException() | Format-List -Force as suggested in #452:
PS C:\code\PSKoans> $Error[0].Exception.GetBaseException() | Format-List -Force
ErrorRecord : You cannot call a method on a null-valued expression.
WasThrownFromThrowStatement : False
Message : You cannot call a method on a null-valued expression.
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException :
TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext,
System.Exception)
StackTrace : at
System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext
funcContext, Exception exception)
at
System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame
frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(Interp
retedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(Interp
retedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object
dollarUnderbar, Object inputToProcess)
at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
Context "Additional Information"
Name Version
---- -------
PSKoans 0.67.0
PSKoans 0.67.0
Name Value
---- -----
PSVersion 5.1.22000.65
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22000.65
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Also attempted using PS 7.1.4 on both Windows and macOS with similar results.
No issues when installing from gallery.
Reacted by Michael Welch and Billy Higdon
Metadata
Metadata
Assignees
Labels
Category-ModulePertaining to the module's functionality itself.Issue-DiscussionLet's talk about it!status: stale
Activity
johnheusinger commentedon Oct 16, 2021
I also found it odd that the version is showing 0.67.0 although the latest release is 0.67.1.
Looking at the 0.67.1 release, I see that the file
PSKoans.psd1incorrectly contains the line:And yet the output of
Get-Module -Name PSKoanscorrectly shows Version 0.67.1 when installed from the gallery.billyhigdon commentedon Dec 21, 2023
Howdy @johnheusinger - I know this is over two years later - but I ran into the same issue. Took me a little bit to figure out the EZOut module stuff (wish I had just looked into the issues sooner). For me I had the same experience when using
Show-Karmaand upon checking my modules, I could see it was using Pester5.5.0- for some reason everytime i imported PSKoans it would import the latest available version of the module - even though5.0.2was installed.I tried going through the code to see where it actually imports the module - i'm assuming somewhere it doesn't explicitly state to use
5.0.2and that's why the latest version is imported. Eventually I just uninstalled5.5.0and next time I imported the PSKoans module, it imported5.0.2and theShow-Karmacmdlet started working as normal.ajn142 commentedon Apr 28, 2026
Only another 3 years later, but I found the cause for that. Per https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_module_manifests?view=powershell-7.6#requiredmodules ModuleVersion is a minimum version, not a specific version, and so PSKoans will always import the latest installed Pester. I also tested, and this error began with Pester 5.2.0. I'll get a patch up later tonight that also sets MaximumVersion to 5.1.1, which should avoid this.
github-actions commentedon Sep 20, 2026
This issue has had no activity for 60 days. It will be closed in 30 days unless there is new activity or a maintainer removes the stale label.