vexx32 / PSKoans

A simple, fun, and interactive way to learn the PowerShell language through Pester unit testing.
GNU General Public License v3.0
1.72k stars 176 forks source link

Show-Karma failed on relatively fresh installation #452

Closed vkuehn closed 3 years ago

vkuehn commented 3 years ago

Describe "Koan Bug, Issue, or Help Request"

Following the instaructions on the Readme.md ends up in a dead end on a clean installation

Context "The Problematic Assertions"

Show-Karma

Context "Your Attempts"

there a missing Modules in the instructions for new comers thought

Context "Additional Information"

Did try in PS 5.1 and 7.1.3 in these steps on a newly machines

  1. git clone https://github.com/vexx32/PSKoans.git
  2. PS 5.1 (upgrade to latest Pester)

    Install-Module Pester -Force -SkipPublisherCheck -Scope CurrentUser -MinimumVersion 5.0.2

PS 6.0+ (Install Pester under current user)

Install-Module Pester -Scope CurrentUser -MinimumVersion 5.0.2

  1. Get-ExecutionPolicy => Bypass
  2. $env:PSModulePath = "$(Get-Location)$([IO.Path]::PathSeparator)${env:PSModulePath}"
  3. Show-Karma

Ends in 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'.

Import-Module PSKoans ends in Import-Module: The member 'FormatsToProcess' in the module manifest is not valid: Cannot find path ...PSKoans.format.ps1xml' because it does not exist..

Install-Module EZOut ends up in conlict messages

vexx32 commented 3 years ago

Did you install from the PSGallery or clone the repository? If the latter, you need to install EZOut (using -AllowClobber, if memory serves, you might need it for the install and the import commands) and then run the PSKoans.ezformat.ps1 script to generate the format file before placing the module folder in a module path for use.

I might need to add some instructions around that to the readme, I'm not sure if I ended up documenting that properly.

vkuehn commented 3 years ago

I did clone the repo. After following your instructions here I get Show-Karma: You cannot call a method on a null-valued expression.

vexx32 commented 3 years ago

Check $Error[0].Exception.GetBaseException() | Format-List -Force for the details of that I suppose, not much to go on there.

vkuehn commented 3 years ago

ErrorRecord : You cannot call a method on a null-valued expression. WasThrownFromThrowStatement : False 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.ActionCallInstruction2.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(Action1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.CommandProcessorBase.Complete() Message : You cannot call a method on a null-valued expression. Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo} InnerException : HelpLink : Source : System.Management.Automation HResult : -2146233087

vexx32 commented 3 years ago

That's definitely an odd one, don't think I've seen that before. Is it the same in 5.1 as well as 7.x versions of powershell for you?

Also, might be worth trying to reinstall just from the gallery with Install-Module PSKoans and seeing if that works out better for you for whatever reason.

vkuehn commented 3 years ago

It complained WARNING: Version '0.67.0' of module 'PSKoans' is already installed at... To install version '0.67.1', run Install-Module and add the -Force parameter, did so. Show-Karma in that git folder shows me Show-Karma: You cannot call a method on a null-valued expression

are you sure you have pushed the latest Stuff ? I'll close it now as I don't think we go here anywhere but will watch the repo and try the next mayor release. looks promissing