none
Set-DnsClientServerAddress -Confirm asks twice RRS feed

  • Question

  • When I use "Set-DnsClientServerAddress -Confirm" it always asks for confirmation twice. Answering "yes" to either (or both) results in the desired changes being applied. I only want it to ask for confirmation once. How can I make it ask only once?

    The double-ask does not seem to be related to the quantity of ServerAddresses I specify, nor does it seem to be related to the quantity of existing ServerAddresses being changed. Tried on Windows 10 1809, Server 2019 1809, and Server 2016 1607. Tried on local machine and on remote machine using CimSession. I am running as admin. No matter what, -Confirm always prompts twice. I don't want this.

    For example:

    Set-DnsClientServerAddress -InterfaceIndex 2 -ServerAddresses "192.168.0.1" -Confirm
    Monday, June 17, 2019 8:50 PM

All replies

  • Set-DnsClientServerAddress -InterfaceIndex 2 -ServerAddresses "192.168.0.1" -Confirm:$false

    Above will work, it won't ask for confirmation.

    If you want the to use it once why not use "Yes to all" (a) instead of "Yes" (y).

    Wednesday, July 17, 2019 2:27 PM