Skip to content

Instantly share code, notes, and snippets.

@flagranterror
Created April 26, 2018 15:05
Show Gist options
  • Save flagranterror/b981d09823d6d857b46648b2ae3d2841 to your computer and use it in GitHub Desktop.
Save flagranterror/b981d09823d6d857b46648b2ae3d2841 to your computer and use it in GitHub Desktop.
DHCP cmdlet
$wiredeth = get-netadapter -ifindex 10
function set-dhcpme {
[CmdletBinding()]
param()
PROCESS {
$wiredeth | remove-netipaddress -confirm:$false
$wiredeth | remove-netroute -confirm:$false
$wiredeth | set-netipinterface -dhcp enabled
$wiredeth | set-dnsclientserveraddress -resetserveraddresses
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment