Skip to content

Fixed an issue with array parameters is key-value pairs (#128) #129

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raandree
Copy link

PR Summary

Fixed an issue with array parameters is key-value pairs (#128).

PR Context

There is a bug in the PSDesiredStateConfiguration 2.0.7 that makes it unusable in some scenarios. The issue is described in #128. The bug does not exist in PSDesiredStateConfiguration 1.0. This PR fixes that.

@SteveL-MSFT
Copy link
Member

If I'm understanding the problem correctly, NameServer is an array or key/value pairs, so in your example, shouldn't $rootHints be an array instead of a hashtable? Trying to make sure I understand the problem before understanding the proposed fix.

Copy link
Member

@SteveL-MSFT SteveL-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also need a test case added

@raandree
Copy link
Author

@SteveL-MSFT, each key/value pair in the hash table is translated into a MSFT_KeyValuePair:

$rootHints = @{
    'A.ROOT-SERVERS.NET.' = '2001:503:ba3e::2:30'
    'B.ROOT-SERVERS.NET.' = '2001:500:84::b'
}

becomes

instance of MSFT_KeyValuePair as $MSFT_KeyValuePair1ref
{
Key = "B.ROOT-SERVERS.NET.";
 Value = "2001:500:84::b";

};

instance of MSFT_KeyValuePair as $MSFT_KeyValuePair2ref
{
Key = "A.ROOT-SERVERS.NET.";
 Value = "2001:503:ba3e::2:30";

};

These MSFT_KeyValuePair instances need to be referenced and this does not work as there is a syntax error.

NameServer = {
       $MSFT_KeyValuePair1ref,
   $MSFT_KeyValuePair2ref
}

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

Successfully merging this pull request may close these issues.

2 participants