Question: Question#1: Write the PowerShell code necessary to prompt the user to enter a number and store that value in a variable called $userPIN using a

Question#1:

  1. Write the PowerShell code necessary to prompt the user to enter a number and store that value in a variable called $userPIN using a datatype of Int32. Type out a listing of your code and paste a screen shot of it running here:

  1. Check if the userPIN entered is positive and if not print out an error message. Type out a listing of your code and paste a screen shot of it running here:

  1. Check if the userPIN entered is at least 4 digits long and if not print out an error message. Type out a listing of your code and paste a screen shot of it running here:

Question#2:

  1. Write the Powershell code to store the following values in string datatype variables as follows:

$ip1 = 172.23.99.10

$ip2= 172.23.99.15

$ip3 = 127.0.0.1

$ip4 =172.23.99.100

Next write the PowerShell code to create an array called $ip_array that contains all of the above variables. Type out a listing of your code and paste a screen shot of it running here:

  1. Write the PowerShell code necessary to loop through the elements of the array from #1 and display a message that the element is Not Local host or Local Host depending whether the ip address in the element is the same as the localhost address. Type out a listing of your code and paste a screen shot of it running here:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!