locked
Unable to add new scope option which supports multi values as input using power shell command RRS feed

  • Question

  • Hi 

    I am trying to add new scope option for windows dhcp server with powershell commands that accepts the multiple values but the parameter -MultiValued is not accepting the either of true/false as input 
    but in the DHCP Microsoft forums says that it accepts false/true 

    PS C:\Users\Administrator> Add-DhcpServerv4OptionDefinition -Name "option_93" -optionId 93 -Type "IPv4Address"               -MultiValued true
    Add-DhcpServerv4OptionDefinition : A positional parameter cannot be found that accepts argument 'true'.
    At line:1 char:1
    + Add-DhcpServerv4OptionDefinition -Name "option_93" -optionId 93 -Type "IPv4Addre ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Add-DhcpServerv4OptionDefinition], ParameterBindingException
        + FullyQualifiedErrorId : PositionalParameterNotFound,Add-DhcpServerv4OptionDefinition

    can any one please help me how get this be done

    Thanks
    Teja

    Monday, January 21, 2019 1:49 PM

Answers

  • -MultiValued is a switch parameter. So you don't need to provide a "$true" to it. It's enough to provide it as it.

    Add-DhcpServerv4OptionDefinition -Name "option_93" -optionId 93 -Type "IPv4Address"  -MultiValued


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''




    • Edited by BOfH-666 Monday, January 21, 2019 2:15 PM
    • Marked as answer by TejaShetty Monday, January 21, 2019 2:56 PM
    Monday, January 21, 2019 2:14 PM

All replies

  • -MultiValued is a switch parameter. So you don't need to provide a "$true" to it. It's enough to provide it as it.

    Add-DhcpServerv4OptionDefinition -Name "option_93" -optionId 93 -Type "IPv4Address"  -MultiValued


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''




    • Edited by BOfH-666 Monday, January 21, 2019 2:15 PM
    • Marked as answer by TejaShetty Monday, January 21, 2019 2:56 PM
    Monday, January 21, 2019 2:14 PM
  • Thank you for the information and clarity on the option 

    Thanks                                                                                                                                                        Teja

    Monday, January 21, 2019 2:58 PM