-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cChocoPackageInstall 'Source' cannot be null or empty #96
Comments
Source needs to allow for an empty value, so the validation should be removed. |
If I understand the way this works, the schema.psm1 works, I believe this is what actually builds the MOF, right? So we can allow for I would lean toward adding the code back into the cChocoPackageInstallerSet.schema.psm1 to ensure MOFs do not define properties with null/empty values. |
Added AutoUpgrade Parameter in keeping with the current format. This is not compatible with curret Test-TargetResource code per issue chocolatey#96. Need to either revert back to Pre chocolatey#86 and go from their or rebuild tests to alow null/empty parameters to be specified in the MOF.
Chocolatey handles the checks. Source does not need to be passed to it, so there should not be any validation that forces it. |
Its not actually validation, the errors are generated because the current GA code as is available in the powershell gallery etc. has error handling built into schema.psm1 to remove 'Source' from the property list if its null. With update #86 this was removed causing null properties to be written into the MOF. The new null values in the MOF are now breaking functions in the cChocoPackageInstall.psm1 file. I'd be happy to clean up the cChocoPackageInstall.psm1 so it will drop null/empty properties. However writing empty properties to the MOF seems like a little messy. Can you specifically address your thought on having empty Properties specified in the MOF? |
I don't want messy, I want the source passed unless it is empty. I guess I misunderstood what you were saying here. #86 was incorrect in that it should have determined whether source should be passed and then pass it every time, not what it is doing where it is unconditionally passing source, even when empty. Does that make sense? |
Yes, I believe I understand what you want. |
I was trying to implement a fix for #80, and ran into errors on Test-TargetResource,
PowerShell DSC resource cChocoPackageInstall failed to execute Test-TargetResource functionality with error message: Cannot validate argument on parameter 'Source'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
It appears to be a bug in #86, Where the code to ensure 'Source' was only included if it was not null or empty was removed.
The text was updated successfully, but these errors were encountered: