The $objectproperties is of type [ChocolateyPackage] has a property value 'Installer'.
This 'Installer' property name is not found in the $properties array and causes the function to throw.
$properties value names are "processScript manifest remoteFiles localFiles path name shim"
$objectproperties value names are "Installer LocalFiles Manifest Name Path ProcessScript RemoteFiles Shim"
I did add an Installer = 'exe' value as a guess to my package.psd1 file to see if that would bypass the exeception but then it threw another error
about "Error validating package configuration: Configuration is missing property ArgumentPrefix for object PackageInstaller"
because of adding an Installer property to my package.psd1 file it makes the script then execute code from
Test-PackageConfiguration below.
switch ($property.Name) {
Installer {
# This property is optional
if ($Configuration['Installer'].Count -gt 0) {
Test-ConfigSection -Object ([PackageInstaller]::new()) -Properties $property.Value.Keys
}
}
This is as far as I got trying to debug but now need help.
As a workaround I hashed out the line from the function Test-PackageConfiguration below.
#Test-ConfigSection -Object ([ChocolateyPackage]::new()) -Properties $Configuration.Keys