Powershell 6 Flashcards

1
Q

What 3 commands would:

show only the service BITS
Stop the service BITs
Start the service BITS

A

get-service -name bits

stop-service -name bits

start-service -name bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What parameter would you use at the end of ‘start-service -name BITS’ to display the result of the command straight away?

A

-passthru

start-service -name BITS -passthru

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What command would export the results of get-service to a csv file and save it to c:\ ? In your example call the csv file service.csv

A

get-service | export-csv c:\service.csv

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What command would import a csv file called services.csv to be to be displayed on the screen?

path of file c:\services.csv

A

import-csv c:\services.csv

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

when pulling information such as get-command from powershell we can ‘export’ and we can ‘convertto’. What is the basic difference between these two commands?

A

Export converts and outputs to a location

convertto just converts and keeps the information there in case you want to use the pipeline to move it over and manipulate it in some way.

Once you use export you are done with the information. You have to send it out to a file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What parameter would you use at the end of a command so that the command doesn’t run, but instead it will tell you what would happen if you ran the command?

A

-whatif

stop-service -name BITS -whatif

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What parameter would you use at the end of a command so that the command asks you to confirm yes or no whether you want to run it?

A

-confirm

stop-service -name BITS -confirm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does thepipeline acually do?

A

The pipeline allows you to set a command and then move the results over (the pipeline) to manipulate with another command.

This way you can use several commands and several pipeline to tell powershell to do this, then do this, and then do this…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What two things does an Object consist of? Describe what each things is

A

An object consists of Properties and Methods.

If a guitar is an object. The propertoes are the strings, the machime heads, the bridge, the tremelo arm etc…..

If an object is a guitar. the methods are what you can do to it. You can play it, you can tune it, You can re-string it, you can re-fret it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you write equals in powershell?

A

-eq

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you qrite greater than in Powershell?

A

-gt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly