This topic contains 6 replies, has 4 voices, and was last updated by
August 6, 2014 at 10:19 am #17821
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.
August 6, 2014 at 10:21 am #17823KeymasterPoints: 1,704Rank: Community Hero
Which bit, exactly, are you having problems with?
August 6, 2014 at 10:21 am #17824ParticipantPoints: 0Rank: Member
Hello, You appear to have only attached an image.
August 6, 2014 at 11:28 am #17825MemberPoints: 0Rank: 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.)
August 6, 2014 at 12:43 pm #17828
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.
August 6, 2014 at 1:22 pm #17829
This is the guideline I must follow.
August 6, 2014 at 2:53 pm #17831
I got a friend to help me out.
The topic ‘Little scripting help’ is closed to new replies.