7.2 Powershell Scripting Flashcards

1
Q

What’s the diffrence between CMD and Powershell

A

Powershell was made for scripting, while CMD is short, simple and easy to learn,

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

Powershell in Cyber Security

A

Defensive security: PowerShell can be used to manage and audit logs. There are many commands for interacting with Windows Event logs. We will be looking at these later.

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

What is PowerShell?

A

PowerShell is a powerful scripting language that lets us locally and remotely manage Microsoft’s line of products.

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

What are objects?

A

“Object” is Microsoft’s name for every component in a system that PowerShell
recognizes and interacts with.

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

True or False:

Despite being a Microsoft product, PowerShell is open source and available on GitHub. By contrast, there’s no source code available for CMD, and writing tools are limited to batch scripts.

A

True

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

Eplain this command:

ls C:\Windows | Where-Object {$_.name -like “system”}

A

Uses a pipe to retrieve only objects containing the word “system”

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

Documentation & Find Commands

How to find documentation on a cmdlet:

A

Get-Help {cmdlet}

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

Documentation & Find Commands

To find documentation on Set-Location:

A

Get-Help Set-Location

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

Documentation & Find Commands

Finding specific examples:

A

Get-Help {cmdlet} -example

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

Documentation & Find Commands

How to find cmdlets by noun:

A

Get-Command -Type Cmdlet | Sort-Object -Property Noun | Format-Table -GroupBy Noun

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

Documentation & Find Commands

How to find cmdlets by verb:

A

Get-Command -Type Cmdlet | Sort-Object -Property Verb | Format-Table -GroupBy Verb

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

Wildcards

How to find by noun:

A

Get-Command -Noun {noun}

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

Wildcards

How to find by verb:

A

Get-Command -Verb {verb}

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