jump to navigation

Fun with Powershell – Network connection reset Tuesday, 04/02/2013

Posted by Percy in Fun with Powershell, Technology.
trackback

I realized that I have never posted one of the Powershell commands (or scriptlets) that I use most often. I use a lot of VMs for my every day development work. Often, the virtualized network connection can get out of whack with my physical network connection. So, I find myself running these three commands over and over:

ipconfig /release
ipconfig /renew
ipconfig /flushdns

It’s somewhat of a “scorched earth” approach to network issues, but it’s short, quick and it seems to work fairly well. I realized that these three commands are the same except for the parameter passed into ipconfig. So, now I just fire up Powershell and fire off this one liner:

@("release", "renew", "flushdns") | % { ipconfig /"$_" }

I’ve turned this into a function in my profile (Reset-Network), but I often forget it’s there and just type the whole thing, since it’s so short.

Anyways, short and simple, but pretty effective. One more reason I’m enjoying playing with Powershell.

Comments»

No comments yet — be the first.

Leave a comment