In this post i will provide you some of the commands i use when configuring dns and ntp in a new environment. i will also display the commands in a script context as i have used them in practise.
Get-VMHostNetwork -VMHost "VMHost" | Set-VMHostNetwork -DomainName "DomainName" -DNSAddress "DNSAddress_Primary" , "DNSAddress_Secondary" -Confirm:$false