DscResource.Tests icon indicating copy to clipboard operation
DscResource.Tests copied to clipboard

Nuget Spec Generated by AppVeyor invalid for PS Module Repository

Open djwork opened this issue 6 years ago • 1 comments

Details of the problem, bug, or enhancement

As part developing the fix issue ComputerManagementDsc #130 I have been running the appveyor build/unit test for my fork. When appveyor runs it generates a sample nuget file. I loaded the file into an internal repository where I store development modules and then tried to install the module via the PackageManagement cmdlets.

But PackageManagement did not recognize the nuget file as a valid PS Module, when comparing the my nuget package with the latest release ComputerManagementDsc.6.2.0.0.nupkg from PS Gallery I notice the where a lot of differences, specifically:

  • from my nuget: DesiredStateConfiguration DSC DSCResourceKit
  • from the release nuget: DesiredStateConfiguration DSC DSCResourceKit DSCResource PSModule PSIncludes_DscResource PSDscResource_Computer PSDscResource_OfflineDomainJoin PSDscResource_PowerPlan PSDscResource_PowerShellExecutionPolicy PSDscResource_ScheduledTask PSDscResource_TimeZone PSDscResource_VirtualMemory PSDscResource_WindowsEventLog

When I manually synced the tags from the release nuget spec into my nuget spec, PackageManagement recognized the nuget file as a valid PS Module and installed it.

When I asked about this over in ComputerManagementDsc #213, @PlagueHO said this issue belonged over on this repository and the problem\solution was probably in AppVeyor.psm1

Verbose logs showing the problem (if applicable)

Suggested solution to the issue

The nuget tags appear to be hard coded in AppVeyor\Invoke-AppveyorAfterTestTask line 1105:

$nuspecParams = @{
      packageName        = $ResourceModuleName
      destinationPath    = $MainModulePath
      version            = $env:APPVEYOR_BUILD_VERSION
      author             = $Author
      owners             = $Owners
      licenseUrl         = "https://github.com/PowerShell/DscResources/blob/master/LICENSE"
      projectUrl         = "https://github.com/$($env:APPVEYOR_REPO_NAME)"
      packageDescription = $ResourceModuleName
      tags               = "DesiredStateConfiguration DSC DSCResourceKit"
  }
  New-Nuspec @nuspecParams

Suggestions:

  1. Append 'DSCResource', 'PSModule' to the tags, from my testing this should be enough to make PackageManagement happy.
  2. Set or append the tags from the resource module's psd1 file (eg ComputerManagementDsc.psd1 PrivateData\PSData\Tags)

djwork avatar Apr 08 '19 19:04 djwork

Thanks @djwork - I'm freed up and will have some time to look into this over the weekend.

PlagueHO avatar Apr 30 '19 07:04 PlagueHO