(???) 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.
Packages install/upgrade without error.
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.
I tried forcing a reinstall of chocolatey-core.extension, but it did NOT help.
Trying to upgrade my existing package installs.
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:
choco upgrade chocolatey-core.extension)Alternatively, you do as @john3voltas and upgrade powershell instead to fix the problem.
Great work.
Thanks, @AdmiringWorm
Most helpful comment
A new version of the
chocolatey-core.extensionhave been pushed to chocolatey.org. Once that version have completed the automated checks, do the following:choco upgrade chocolatey-core.extension)Alternatively, you do as @john3voltas and upgrade powershell instead to fix the problem.