locked
PowerShell replacements for ipconfig /release and /renew RRS feed

  • Question

  • I am looking for a way to release/renew a DHCP-assigned ipv4 address with PowerShell. Unfortunately, I have not found a way that doesn't utilize WMI components. I find it neigh-impossible that there is no way to do this with plain PowerShell. Can anyone help me out?

    Thanks!

    Monday, December 10, 2018 5:32 PM

Answers

  • ipconfig /renew


    \_(ツ)_/

    • Proposed as answer by BOfH-666 Monday, December 10, 2018 11:44 PM
    • Marked as answer by Geekocity Monday, December 17, 2018 4:08 PM
    Monday, December 10, 2018 7:07 PM

All replies

  • ipconfig /renew


    \_(ツ)_/

    • Proposed as answer by BOfH-666 Monday, December 10, 2018 11:44 PM
    • Marked as answer by Geekocity Monday, December 17, 2018 4:08 PM
    Monday, December 10, 2018 7:07 PM
  • Remember: PowerShell is a shell (it's in the name), which means it can run commands by just typing them.

    Thus: There's no need for any workaround. Just type the commands at the PowerShell command prompt, the same way you normally would with cmd.exe (as jrv pointed out).


    -- Bill Stewart [Bill_Stewart]

    Tuesday, December 11, 2018 3:19 PM
  • I can appreciate that PowerShell can run executables, and not just CMDlets, but there's a difference between having first-class capabilities in PS (which accept and return objects, etc), and leveraging external tools and libraries. Much of what can be done in PowerShell can be accomplished with netsh, external commands, and the like; however, having native capabilities is cleaner, and carries advantages. It seems strange, for a product as mature as PowerShell, that you can manipulate static IPs, routes, etc, but not dynamic. I figured I was missing something, but it would seem that the functionality is simply missing.

    Thank you, and jrv, for your insight.

    • Edited by Geekocity Friday, December 14, 2018 4:28 PM Plugin corrupted text
    Wednesday, December 12, 2018 11:06 PM
  • Your post is not readable (there appears to be junk html inserted).

    -- Bill Stewart [Bill_Stewart]

    Thursday, December 13, 2018 2:55 AM
  • I fixed it. Looks like a plugin had a field day with the message.
    Friday, December 14, 2018 4:29 PM
  • Do you still have a question?

    -- Bill Stewart [Bill_Stewart]

    Friday, December 14, 2018 5:41 PM
  • At this point, I suppose not. Thanks
    Monday, December 17, 2018 4:10 PM