Skip to content

NuGet_PSModule has Key on Ensure instead of Name #5

Description

@gaelcolas

Using NuGet_PSmodule with 2 packages fails with the following error:

$$$$$$ Test-ConflictingResources : A conflict was detected between resources
$$$$$$ '[Nuget_Module]PSRabbitMQ (::128::9::Nuget_Module)' and
$$$$$$ '[Nuget_Module]RabbitMQTools (::135::9::Nuget_Module)' in node 'localhost'.
$$$$$$ Resources have identical key properties but there are differences in the
$$$$$$ following non-key properties: 'Version;Name'. Values '0.1;PSRabbitMQ' don't
$$$$$$ match values '1.0;RabbitMQTools'. Please update these property values so that
$$$$$$ they are identical in both cases.
$$$$$$ At line:271 char:9
$$$$$$ +         Test-ConflictingResources $keywordName $canonicalizedValue $k ...
$$$$$$ +         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I believe it's a mistake in the resource key that is on 'ensure' instead of name.
It should be like:

[DscResource()]
class Nuget_Module {
  #Declare Properties
  [DscProperty(Mandatory)]
  [ensures] $Ensure
  [DscProperty(Key)]
  [string] $Name
  [DscProperty()]
  [string] $Version
  [DscProperty(Mandatory)]
  [string] $ProviderName

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions