Powershell 5 Flashcards

1
Q

What command would display and sort the contents of a directory into alphabetical order?

A

get-childitem | sort-object

This command defaults to sorting in ascending alphabetical order

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

What are the 4 different ways to examine the Help system in Powershell?

A
  • examples
  • online
  • detailed
  • full
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What command would run two previously run commands from the Get-History list? In the example run commands 1 and 2 from the list.

A

invoke-history 1; invoke-history 2

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

What is the shell as in powerSHELL?

A

A user interface that gives you access to the operating system.

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

Just by looking at the shell, how would you know whether or not it was opened as Administrator?

A

It would say ‘Administrator; on the title bar if it was opened as Administrator.

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

What Font is good for Powershell?

A

A matter of preference, but Lucida Console is a good one to use.

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

What does a parameter do in Powershell?

A

Parameters alter the command

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

What command would force an update of the help system in Powershell?

A

update-help -force

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

What would be an easy way to get help on get service but only show the syntax part of the help file?

A

get-help get-service -showwindow

The above command will open a separate window and will allow you to go into settings and choose what part of the help file you want to see.

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

Parameters alter a command. What character does a parameter always begin with?

A

Parameters always begin with a dash

eg;

  • examples
  • onlne
  • detailed
  • full
How well did you know this?
1
Not at all
2
3
4
5
Perfectly