Little scripting help

This topic contains 6 replies, has 4 voices, and was last updated by Profile photo of Viji keswaran Viji keswaran 2 years, 10 months ago.

  • Author
  • #17821
    Profile photo of Viji keswaran
    Viji keswaran

    I'm having a really hard time making a script which contains 4 functions which will automatically draw a box menu and change your TCP/IP settings from static to DHCP or vice versa.

    Create a Set-DHCP function to enable DCHP on the local computer
    Create a Set-StaticIP function to change from DHCP to static addressing.
    Make sure to SetDynamicDNSRegistration to “false”.

    If anyone can help, that will be greatly appreciated. THANKS

    The menu should look like this below.

  • #17823
    Profile photo of Don Jones
    Don Jones

    Which bit, exactly, are you having problems with?

  • #17824
    Profile photo of Adnan Rashid
    Adnan Rashid

    Hello, You appear to have only attached an image.

  • #17825
    Profile photo of Dave Wyatt
    Dave Wyatt

    Rocking the ASCII art menus! Takes us back to 1990...

    These days, why bother with all the lines and blocks? If you want a GUI, there are much nicer options. Modern command-line scripts and utilities rarely go to the trouble of that sort of menu.

    The PowerShell Host has a built-in PromptForChoice method which you might like. It's what gets used when you set one of the action preference variable to 'Confirm', and so on. Check out for an example of it. (In PowerShell.exe, this will be a command-line prompt. In the ISE, it's a GUI pop-up.)

  • #17828
    Profile photo of Viji keswaran
    Viji keswaran

    Problems with all of the steps. I know, I'am an amateur to coding via Powershell but my strength is in Linux. I just started doing windows administration.

    Dave that was and excellent source you provided me, only issue is I must use ASCII to create the menu.

  • #17829
    Profile photo of Viji keswaran
    Viji keswaran

    This is the guideline I must follow.

  • #17831
    Profile photo of Viji keswaran
    Viji keswaran

    I got a friend to help me out.


You must be logged in to reply to this topic.