Question

Create a variable $a and assign it a value of 3 then use the write-host command...

  1. Create a variable $a and assign it a value of 3 then use the write-host command to display the value.

  2. Write a command to find the type of variable $a.

  3. Create a variable $myname with your firstname and surname in it. Use the pipe symbol and gm to work out what methods are available to make it all uppercase or lowercase.

  4. Write a command that displays only the services that are running.

  5. Write a command that displays only the services that are not running.

-Powershell-

Screenshots will be helpful Thank You!!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

2) $a="3"

$a.GetType().name

$a="3"

$a.GetType().name

Create a variable $myname with your firstname and surname in it. Use the pipe symbol and gm to work out what methods are available to make it all uppercase or lowercase.

$myname="firstname lastname"
$myname | gm

$myname="firstname lastname"
$myname | gm

$myname.Toupper()

Write a command that displays only the services that are running.

Get-Service | Where-Object {$_.Status -eq "Running"}

Write a command that displays only the services that are not running.

Get-Service | Where-Object {$_.Status -eq "Stopped"}

If you require any additional information please feel free to ask

Add a comment
Know the answer?
Add Answer to:
Create a variable $a and assign it a value of 3 then use the write-host command...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a Java program to do the following with your name. This can all be done...

    Write a Java program to do the following with your name. This can all be done in the main() method. 1. Create a String variable called myName and assign your personal name to it. Use proper capitalization for a legal name. I.e. String myName = "Billy Bob"; 2. Load myName with the upper case version of itself and display the result. 3. Load myName with the lower case version of itself and display the result. 4. Capitalize the first letter...

  • Write a MATLAB program to accomplish the following: Create a variable x by assigning it the...

    Write a MATLAB program to accomplish the following: Create a variable x by assigning it the value 5. Then, subtract 8 from the square of x and assign the result to a second variable y. Next, create a vector z containing as values all the positive prime integers greater than or equal to 2 and less than 20. Multiply z by two and subtract y, and assign the result to w. ONLY display the value for w in the Command...

  • Create a variable named my_student_ID and assign YOUR STUDENT ID to it. Write a program that...

    Create a variable named my_student_ID and assign YOUR STUDENT ID to it. Write a program that generates a random integer between 1 and 10, inclusive; then displays the generated random integer and digits in my_student_ID that are less then or equal to the generated integer as a list. For example, if your student id is 45755245642 and the computer generates 4, then your program should display the below message random integer is 4 list of integer that are less than...

  • 1. Create a String variable named menuChoice. 2. Display 3 options for your program. I recommend...

    1. Create a String variable named menuChoice. 2. Display 3 options for your program. I recommend using 3 System.out.println statements and a 4th System.out.print to show "Enter your Selection:". This needs to be inside the do -- while loop. A. Deposit Cash. B. Withdraw Cash X. Exit Enter your Selection: 3. Prompt for the value menuChoice. 4. If menuChoice is "A", display "Do Deposit" and redisplay the menu. If menuChoice is "B", display "Do withdrawal" and redisplay the menu. If...

  • Create a class called Play that has an InputReader as an instance variable. Be sure to...

    Create a class called Play that has an InputReader as an instance variable. Be sure to initialize it in the constructor. The class has two methods. Write a method with this signature: Write a method with this signature: public void stringPlay() The method prompts the user for a string, reads it in, and then displays the string as many times as the length of that string. The output string should be formatted with the first letter uppercase and the rest...

  • USE Python 1. Assign value 555 to the variable x, write code to square the variable...

    USE Python 1. Assign value 555 to the variable x, write code to square the variable x and print out the result. 2. Given a string x, write a program to check if its first character is the same as its last character. If yes, the code should output "True" . 3. We defined two variables, x = 'Python' and y = '3.0'. Write code to concatenate the two numbers (the result should be 'Python3.0').

  • Using Swift playground and / or the command line for macOS (open Xcode, create a new...

    Using Swift playground and / or the command line for macOS (open Xcode, create a new Xcode project, macOS, command line tool), practice the following exercises: Exercise: Swift Variables Declare 2 variables/constants with some random values and any name of your choice Considering these 2 variables, one as a value of PI and other as a radius of circle, find the area of circle Print the area of circle Declare a string variable explicitly with value “Northeastern”. Declare a string...

  • 1. Write the command to set the following permissions on a script file with the following...

    1. Write the command to set the following permissions on a script file with the following name; myscript.sh Owner: full access; read, write and execute Group: read and execute Other: no access 2. Create a new file with the name "myfirstscript.sh". Write a new script that performs the following tasks in sequence; Display the usernames of currently logged in users; sorted from a-z HINT: You will need to filter the output of the whocommand Display a list of usernames who...

  • In this exercise, you will create a script called if_then_else.sh that uses an IF THEN ELSE...

    In this exercise, you will create a script called if_then_else.sh that uses an IF THEN ELSE statement. The if_then_else.sh script will Use one command line argument, which will be a number between 1 and 10 Assign the value of the first argument to a local variable called NUM. HINT: Look at line 5 in the example screenshot for arguments.sh Use one IF THEN ELSE statement to compare the value of NUM If the number is less than 5, display the...

  • SQL CODE – System Variables System variables can be set via the command line. Please write a sequence of statements to: Set safe updates to false for the session. Do the following at the global level...

    SQL CODE – System Variables System variables can be set via the command line. Please write a sequence of statements to: Set safe updates to false for the session. Do the following at the global level: Set the maximum number of connections to 45. Set the threshold for long running queries to 7 seconds – do this at the global level. Set logs to expire when they are more than 3 days old Write the commands to display the value...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT