Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerShell Mini-Scripting Games 2014: Problem 5

$
0
0

Summary: Here is the final problem in Windows PowerShell Mini-Scripting Games 2014.

Microsoft Scripting Guy, Ed Wilson, is here. This is it. It is day five of the Mini-Scripting Games. Next week, I will share solutions to the questions (PowerTips) and problems from this week.

Problem 5 description

Your manager has tasked you to help a junior admin with a script. It appears that the junior admin wants to solicit input from the user when the script is running. Then based on the input from the user, the script will  do something else.

Task

You only have to write a piece of sample code that will solicit input from the command line, and then take action based on the input. Your manager does not want you to write the script for the junior admin, only to help him over the hurdle.

Hint: Depending on your situation, you may want to consider limiting the input, or testing the permissible input to provide a more robust example. You might even consider creating a bit of error checking to help with improper input.

This is all of the events for the Windows PowerShell Mini-Scripting Games 2014. Join me tomorrow for a special post from the Scripting Editor. It is way cool, and it provides special insider information about the Hey, Scripting Guy! Blog. Hey, it is like a backstage pass…only better.

I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scripter@microsoft.com, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.

Ed Wilson, Microsoft Scripting Guy 


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>