Chocolatey-coreteampackages: Packages failing to install/upgrade due to chocolatey-core.psm1

Created on 31 Oct 2019  路  10Comments  路  Source: chocolatey-community/chocolatey-coreteampackages


(???) Upgrade/install of some packages is failing with the following error message:

You must provide a value expression on the right-hand side of the '-' operator.
The specified module 'C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1' was not loaded because no valid module file was found in any module directory.

Expected Behavior


Packages install/upgrade without error.

Current Behavior


I get an error message:

You must provide a value expression on the right-hand side of the '-' operator.
The specified module 'C:\ProgramData\chocolatey\extensions\chocolatey-core\chocolatey-core.psm1' was not loaded because no valid module file was found in any module directory.

Possible Solution



I tried forcing a reinstall of chocolatey-core.extension, but it did NOT help.

Steps to Reproduce (for bugs)


  1. cinst -y --force notepadplusplus

Context



Trying to upgrade my existing package installs.

Your Environment

Bug

Most helpful comment

A new version of the chocolatey-core.extension have been pushed to chocolatey.org. Once that version have completed the automated checks, do the following:

  1. First update the extension (choco upgrade chocolatey-core.extension)
  2. Install the package you want.

Alternatively, you do as @john3voltas and upgrade powershell instead to fix the problem.

All 10 comments

The following files are in C:\ProgramData\chocolatey\extensions\chocolatey-core:

chocolatey-core.psm1
Get-AppInstallLocation.ps1
Get-AvailableDriveLetter.ps1
Get-EffectiveProxy.ps1
Get-PackageCacheLocation.ps1
Get-PackageParameters.ps1
Get-UninstallRegistryKey.ps1
Get-WebContent.ps1
Register-Application.ps1
Remove-Process.ps1

Used Chocolatey GUI to update the affected packages, and it worked fine. I wonder if CMD.EXE is invoking the wrong version of PowerShell or something?

I will close this as it is 99% some effect specific to your system. If it happens again to you let us know here.

i'm getting this too, happening for np++ and qbittorrent [choco upgrade all -y]
what gets me is that the specified file [chocolatey-core.psm1] is right there, but i still get the error...

/cc @f

I have nothing to do with this 馃槄

Nice catch @AdmiringWorm

Ok, I had this same issue and apparently I was able to workaround by simply:

'choco install powershell -y'

What happens is that this way I upgraded the powershell and now even when I am invoquing choco from a CMD shell everything works just fine.

Please be advised that if you upgrade powershell through choco you may find an issue where Windows upgrades the powershell app and then it needs to restart but Windows apparently doesn't inform choco of that.
So I stood there waiting for choco to finish upgrading PS for more than 2 hours while the Windows Update window kept nagging me that it needed to restart Windows. I thought it was nagging me due to other updates that had nothing to do with choco, so I waited while I was working on other stuff.
But since it was taking so much time I then decided to stop choco, rebooted "et voil谩", PS had actually finished upgrading and now both CMD and PS work fine for using choco.
Thanks.
Cheers

A new version of the chocolatey-core.extension have been pushed to chocolatey.org. Once that version have completed the automated checks, do the following:

  1. First update the extension (choco upgrade chocolatey-core.extension)
  2. Install the package you want.

Alternatively, you do as @john3voltas and upgrade powershell instead to fix the problem.

Great work.
Thanks, @AdmiringWorm

Was this page helpful?
0 / 5 - 0 ratings

Related issues

majkinetor picture majkinetor  路  4Comments

verglor picture verglor  路  5Comments

kilasuit picture kilasuit  路  5Comments

ericoporto picture ericoporto  路  3Comments

kaffeekanne picture kaffeekanne  路  4Comments