dsccommunity / xDhcpServer

This module contains DSC resources for deployment and configuration of Microsoft DHCP Server.
MIT License
26 stars 33 forks source link

xDhcpServerOption Router option #37

Closed joes closed 4 years ago

joes commented 6 years ago

It seems that the Router option of xDhcpServerOption must always be set? Is there any way to leave it unspecified? If I leave it unspecified I get the following error:

The variable cannot be validated because the value System.String[] is not a valid value for the Router variable.
    + CategoryInfo          : MetadataError: (:) [], CimException
    + FullyQualifiedErrorId : ValidateSetFailure
    + PSComputerName        : localhost
mikejwhat commented 6 years ago

I second this

johlju commented 6 years ago

The Router property is set to Write in the schema, but has a [ValidateNotNullOrEmpty()] on it that generates that error message. It looks like if that is removed from the parameter the code could work without specifying Router parameter (line 133 could pose a problem).

https://github.com/PowerShell/xDhcpServer/blob/a748ae1965e5a757e4c8916822712b53465670cb/DSCResources/MSFT_xDhcpServerOption/MSFT_xDhcpServerOption.psm1#L97-L98

So either the Router parameter should be requiredin the schema or the value should be able to be left out in a configuration.

1RedOne commented 6 years ago

For the meantime, what is this option meant to control? Can't find it in the documents

johlju commented 6 years ago

You are correct, it's missing there, that should be resolved too. If I'm not mistaken its used to set gateway addresses.

1RedOne commented 6 years ago

For those curious, the router option is a really oddly named setting which really corresponds to the default gateway for that DHCP Configuration. Why isn't this just named 'Default Gateway'

johlju commented 6 years ago

For information. @1RedOne updated the documentation in PR #42, but the main issue still need to be resolved.

johlju commented 4 years ago

The resource xDhcpServerOption was deprecated when the resource DhcpScopeOptionValue was released. The resource xDhcpServerOption will be removed in the next release.