Description
What You Are Seeing?
When the Chocolatey Licensed extension fails to load some of the expected helper cmdlets won't be available due to the importing being aborted before everything is processed.
This also affects when normal extensions are imported if they fail to be imported in some way.
This especially affects users of the AU extension which makes a monkey patch of the cmdlets to make maintenance easier for the user, in which case the Licensed extension can not be loaded.
What is Expected?
All cmdlets available in open source Chocolatey should be loaded even in the case where an extension is failing to load, even if that extension is the Licensed edition of Chocolatey.
Before Chocolatey 0.11.0 failing to import any extension with a DLL extension would report a Warning, but continue execution. After 0.11.1 this has been changed to an error, and is preventing the execution of the module loading.
How Did You Get This To Happen? (Steps to Reproduce)
- Have Chocolatey 0.11.1+ and a supported Licensed extension installed.
- Create a new package that uses the
Get-ChocolateyWebFile
cmdlet. - Create an AU update script for updating the package.
- Ensure the monkey patched scripts are first removed (
Remove-Item $env:TEMP\chocolatey\au
- Force a package update using the created AU update script.
Output Log
Chocolatey Log
No log file available
AU Log
Console:
Updating 1 automatic packages at 2021-10-21 12:54:36 (forced)
Push is disabled
NoCheckChocoVersion is disabled
FORCE IS ENABLED. All packages will be updated
[1/1] veeam-one-iso ERROR:
The term 'Get-ChocolateyWebFile' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. (3,77s)
Log File:
veeam-one-iso - checking updates using au version 2021.7.18
URL check
https://download2.veeam.com/VONE/v11/VeeamONE_11.0.1.1880_20210922.iso
nuspec version: 11.0.1.1880
remote version: 11.0.1.1880
No new version found, but update is forced
New version is available
Automatic checksum started
Manual Import
> import-module $env:ChocolateyInstall\helpers\chocolateyInstaller.psm1
Import-Module : Could not load file or assembly 'chocolatey, Version=0.10.15.0, Culture=neutral, PublicKeyToken=79d02ea
9cad655eb' or one of its dependencies. Systemet finner ikke angitt fil.
At C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1:76 char:13
+ Import-Module $licensedExtensionPath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand