Create a directory in your work environment name test_users. Write a PowerShell
ID: 3800653 • Letter: C
Question
Create a directory in your work environment name test_users.
Write a PowerShell script to:
a. Create the following output Enter User’s Full Name : Enter User’s ID : Enter User’s Job Location : eg: PX17 , AM91 [AA99 pattern must ,match] Enter User’s Manager Code : Run this script, read input and print the result on screen.(Get a screen dump)
b. Add more code to the above script to pipe the output (i.e. user’s information) to a file named firstname_lastname.usr and save that file in the test_users directory created above. [Test with at least 2 users. Then Get a screen dump of the test_users directory]
Explanation / Answer
a)
mkdir test_user
#!/bin/bash
echo -n " Enter Users full name > "
read text
echo "Users full name is: $text"
echo -n " Enter Users ID > "
read text1
echo "Users ID is: $text1"
echo -n " Enter Users job location > "
read text2
echo "Users job location is: $text2"
echo -n " Enter Manager Code > "
read text3
echo "Users full name is: $text3"
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.