cChoco
cChoco copied to clipboard
Include exported DSC resources in the module manifest file
Describe the bug On push to private repo
WARNING: This module 'C:\Users\fladmin\AppData\Local\Temp\1886670852\cChoco\cChoco.psd1' has exported DscResources. As
a best practice, include exported DSC resources in the module manifest file(.psd1). If your PowerShell version is
higher than 5.0, run Update-ModuleManifest -DscResourcesToExport to update the manifest with ExportedDscResources
field.
To Reproduce Steps to reproduce the behavior:
Register-PSRepository -Name pwsh -InstallationPolicy Trusted -SourceLocation https://nexus.local/repository/pwsh/ -PackageManagementProvider nuget -PublishLocation https://nexus.local/repository/pwsh/
Publish-Module -Name ".\cchoco" -Repository pwsh -NuGetApiKey "123"
Expected behavior Clean push without warnings
Software (please complete the following information):
- Server 2022
- PowerShell Version 5.1
- cChoco 2.5.0.0 / 2.5.0
I suspect this might be causing the error I'm having right now:
ERROR: The PowerShell DSC resource cChocoInstaller from module <cChoco,2.6.0.0> does not exist at the PowerShell module path nor is it registered as a WMI DSC resource.
Will try updating my local manifest copy with the resources and submit a fix if that helps.
Update 1: Turns out that we can't actually add the property at all without breaking powershell compatibility pre 5.0:
Update-ModuleManifest: The ExportedDscResources property is not supported in module manifests on PowerShell versions that are older than 5.0. Remove the value for the parameter 'DscResourcesToExport', and then try again.
Update 2: It also doesn't help with the error I was getting at all.