JustinGrote / JustinGrote/PowerConfig

Import-Module -Name "PowerConfig" Fails

Open
#7 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
29
Forks
2
PR merge metrics
No merged PRs in 30d

Description

I am hoping this repo is still maintained, or I'd be happy to help with a little guidance.

I tried importing the module and am getting this error:

```
PS C:\Users\ronhowe\repos\ronhowe\powershell>
PS C:\Users\ronhowe\repos\ronhowe\powershell> Import-Module -Name "PowerConfig"
Add-Type: C:\Users\ronhowe\Documents\PowerShell\Modules\PowerConfig\0.1.6\LoadAssemblies.ps1:60:1
Line |
60 | Add-Type -Path "$libPath/*.dll"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Could not load file or assembly 'Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
ParserError: Unable to find type [Microsoft.Extensions.Configuration.ConfigurationProvider].
Import-Module: Could not load file or assembly 'PowerConfig.psm1, Culture=neutral, PublicKeyToken=null'. Invalid pointer (0x80004003 (E_POINTER))
PS C:\Users\ronhowe\repos\ronhowe\powershell>
```

This worked maybe a year ago (or two). Many versions of .NET and PowerShell later and it seems to have broken for me.

Some hopefully useful debugging information.

```
PS C:\Users\ronhowe\repos\ronhowe\powershell> pwsh --version
PowerShell 7.3.4
PS C:\Users\ronhowe\repos\ronhowe\powershell> dotnet --version
7.0.203
PS C:\Users\ronhowe\repos\ronhowe\powershell> Get-Module -Name "PowerConfig" -ListAvailable

Directory: C:\Users\ronhowe\Documents\PowerShell\Modules

ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 0.1.6 PowerConfig Desk {Add-PowerConfigCommandLineSource, Add-PowerConfigEnvironmentVari…

PS C:\Users\ronhowe\repos\ronhowe\powershell>
```

Let me know if I can help. I would love to keep this going. I have forked your repo and will try to figure out a fix. (I have *some* software development experience).

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with PowerShell 7.3.4 and .NET 7.0.203, then inspect LoadAssemblies.ps1 at line 60 where Add-Type loads the DLLs. Trace the missing Microsoft.Extensions.Primitives dependency and verify that Import-Module -Name "PowerConfig" completes without the assembly or ConfigurationProvider errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.