Question

Write a powershell script which will ask the user to enter a number. If the answer...

Write a powershell script which will ask the user to enter a number. If the answer is not equal to 10 display message "Congratulations".

Homework Answers

Answer #1

Executable Code:

$s = Read-Host "Please enter any number"
if($s -eq 10){
write-host("Congratulations")
}
else{
write-host("Try again")
}

Sample Output :

Please comment below if you have any queries.
Please do give a thumbs up if you liked the answer thanks :)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a script that plays a simple “guess the number” game with the user. It should...
Write a script that plays a simple “guess the number” game with the user. It should select a random integer in the range [0 - 10], ask the user to guess the value, and provide feedback of the form “too high”, “too low”, or “congratulations” as appropriate. After the correct value is guessed, the script should terminate.
Write the C++ language statements to ask a user to enter a number within the range...
Write the C++ language statements to ask a user to enter a number within the range of 0 to 100 (0 and 100 are valid inputs). When the value is not valid, you should prompt the user to enter another value. (The user may enter many invalid numbers, so you must use loop). Only after the user enters a valid number should you display the message “Good” and the value of the number.
Name the script for.sh.  This script will create a shopping list. Ask the user to enter items...
Name the script for.sh.  This script will create a shopping list. Ask the user to enter items separated by a space. Read the list. Use a for loop to write (use echo) the items to a file called shopping_list. You should use >> to append the output to the file, so each time the script is run the list should get longer. After the for loop finishes, display (use cat) the contents of the shopping list with 1 item per line....
Write a mips assembly language program that asks the user to enter and integer number and...
Write a mips assembly language program that asks the user to enter and integer number and read it. Then ask him to enter a bit position (between 0 and 31) and display the value of that bit.
Write a python code that will ask the user to enter an integer number n. Construct...
Write a python code that will ask the user to enter an integer number n. Construct a recursive function that prints numbers 1 to n in the form “11223344..nn”.
Write a while loop to ask the user to type number of hours(double) they work per...
Write a while loop to ask the user to type number of hours(double) they work per day. Calculate and print the salary for each valid input. If number of hours is greater than or equal to 0 and less than 5, then:  salary = numberofhours * 5, loop continues, the user can type another number If number of hours is greater or equal to 5, and less than 10, then: salary = numberofours * 8, loop continues, the user can type...
Classwork_1.5: Write a C code that ask the user to enter the name of person, gender...
Classwork_1.5: Write a C code that ask the user to enter the name of person, gender (male or female) and age and display these quantities. You need to create a structure to solve this problem. Output:
Write a C program to ask the user 3 number and display in the greater value...
Write a C program to ask the user 3 number and display in the greater value from it. Only use compound condition in if-Else statements.
This is for my linux class. Write a script called activity4.2-3 that modifies your activity4.2-2 script...
This is for my linux class. Write a script called activity4.2-3 that modifies your activity4.2-2 script to also display a message when the user provided is not logged on. An example is shown below. Purpose: Determine if someone is logged on bash-3.2$ ./activity4.2-3 nonuser nonuser is either not logged on or not a valid user Include a first line that calls the bash shell as the interpreter Add a comment to state the purpose of the script and other comments...
8.39 Lab 8d: Even Entry Loop This program will ask the user to enter an even...
8.39 Lab 8d: Even Entry Loop This program will ask the user to enter an even number and continue to do so until they enter the given QUIT condition. The prompt for the user to enter a number is written as follows: "Enter an even number or [QUIT] to quit:" The quitting condition in this case will be the number 999. If the number they entered was an even number, output the message "Good job!" Otherwise, output the message "[number]...