128 Midterm Prep Flashcards

(29 cards)

1
Q

What is the basic syntax of a powershell command?

A

Verb-Noun

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

What is the use of the Get-Help command?

A

Get-Help provides valuable information on parameters and cmdlets in PS

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

What are some types of input used in PowerShell?

A

Strings, Ints, DateTime, Arrays

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

What are strings?

A

Strings are a series of letters and numbers that may include spaces.

You can define a string by using double quotes.

Example: “This is a string”

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

What are ints?

A

Ints are integers or whole numbers.

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

What is the DateTime input type?

A

DateTime is a string that PowerShell can interpet as a date based on your computers regional settings.

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

What is an array?

A

An array is a collection or list of strings.

You can define an array as a parameter using enpty square brackets.

Example

Param

(

[string[]$variable

)

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

What are some aliases for Get-Help?

A

help and man are both aliases for Get-Help.

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

What is an alias?

A

An alias is an alternate, usually shorter name for a cmdlet.

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

What is the difference between cmdlets and commands?

A

Cmdlets are unique to PowerShell.

Commands are a general term that covers cmdlets, functions, workflows, etc. and are not nessicarily unique to PS.

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

What are positional parameters?

A

Positional parameters are parameters that can only be passed based on the position they are inputted into a command.

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

Describe the basic anatomy of a PowerShell command.

A

Using this as an example:

Get-Eventlog -Logname ABC -ComputerName D, E -Verbose

Get-Eventlog is the name of the Cmdlet

  • Logname ABC is the parameter naming the event log with the value ABC
  • ComputerName -D, E is the second parameter, and is given 2 values seperated by commas
  • Verbose is the final switch parameter (meaning it is not given a value.)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are parameters always prefaced by in a command?

A

Parameters always have a dash (-) at the front.

-ThisIsAParameter

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

What are providers?

A

Providers are adapters. They are designed to take data storage and make it look like a disk drive.

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

What command is used to retrive all processes currently running on your system?

A

Get-Process retrieves a list of all processes.

Stop-Process is used to kill a currently running process.

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

What is the pipeline?

A

The pipeline is the process of connecting multiple commands into eachother?

For example:

Dir | More

You are piping the Dir command into the More command to get more information.

17
Q

How do you pipe two commands together?

A

You pipe commands together using a pipe (|)

haha

18
Q

What are snapins?

A

SnapIns are a type of extension for PowerShell. These consist of one or more DLL Files accompanied by an addintional config XML File.

19
Q

What are Modules?

A

Moduels are self-contained and easy to distribute SnapIns with no advanced registration.

20
Q

What are objects?

A

Objects represent a single PS Process or service.

21
Q

What are properties of objects?

A

Properties represent one single piece of information about an object such as a name, ID, service status, etc.

22
Q

What is a collection?

A

A collection is an set of objects (list, table, etc.)

23
Q

How does powershell use objects?

A

Objects are used in powershell to represent data. PowerShell is an Object Oriented Programming system.

24
Q

What does the Get-Member command do?

A

Get-Member (Alias: Gm) Gets all the information about an object.

25
What are the two main parts of Objects in Powershell?
Object properties and Object methods.
26
What are object methods?
Methods are the things that we can do with a specified object.
27
28
What are the main aspects of a file system?
Files, folders and drives make up file systems.
29