Reference no: EM134031331
Problem
For the following questions you can use any one of your VM's (dc, dm, or sws). All screen shots must have your VM# in the corner. All code and output must be clearly legible.
Task
Part I
A. 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:
B. 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:
C. Check if the userPIN entered is at least 4 digits long (i.e. > 999) and if not print out an error message. Type out a listing of your code and paste a screen shot of it running here:
Part II
A. 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. Get the instant assignment help.
B. 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.