Skip to content
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

Include exported DSC resources in the module manifest file #172

Open
FLeven opened this issue Oct 27, 2022 · 1 comment
Open

Include exported DSC resources in the module manifest file #172

FLeven opened this issue Oct 27, 2022 · 1 comment

Comments

@FLeven
Copy link

FLeven commented Oct 27, 2022

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
@Tzrlk
Copy link

Tzrlk commented Dec 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants