Little scripting help

Welcome Forums General PowerShell Q&A Little scripting help

This topic contains 6 replies, has 4 voices, and was last updated by

 
Participant
4 years, 4 months ago.

  • Author
    Posts
  • #17821

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    Which bit, exactly, are you having problems with?

  • #17824

    Participant
    Points: 0
    Rank: Member

    Hello, You appear to have only attached an image.

  • #17825

    Member
    Points: 0
    Rank: Member

    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 http://technet.microsoft.com/en-us/library/ff730939.aspx 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

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    This is the guideline I must follow.

  • #17831

    Participant
    Points: 0
    Rank: Member

    I got a friend to help me out.

    Thanks.

The topic ‘Little scripting help’ is closed to new replies.