19-D Flashcards

1
Q

What is the primary purpose of scripting in IT support?

A

To automate repetitive tasks for greater consistency and to simplify configuration changes

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

What are the three helpful distinctions in coding languages?

A
  • Shell scripting language
  • General-purpose scripting language
  • Programming language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a shell scripting language?

A

A language that uses commands specific to an operating system

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

What distinguishes a general-purpose scripting language?

A

It uses statements and modules independent of the operating system and is executed by an interpreter

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

What is the purpose of a shebang line in a shell script?

A

To designate which interpreter to use

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

What is the typical file extension for a Linux shell script?

A

.SH

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

What is the comment delimiter in Bash scripting?

A

#

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

What is a variable in scripting?

A

A label for a value that can change as the script executes

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

In Bash, how are positional parameters referred to?

A

$1, $2, etc.

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

What is a branch in scripting?

A

An instruction to execute a different sequence of instructions based on a logical test

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

What does a ‘For’ loop do in scripting?

A

Repeats a statement block a predictable number of times

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

What is the command to restart a host in Bash?

A

shutdown -r

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

What is the main purpose of Windows PowerShell?

A

To combine a script language with prebuilt modules (cmdlets) for managing Windows features

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

What file extension is used for PowerShell scripts?

A

.PS1

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

What is VBScript based on?

A

Microsoft’s Visual Basic programming language

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

What is the file extension for a Windows batch file?

A

.BAT

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

What are the two major versions of Python?

A

Version 2 and Version 3

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

What is the significance of the .PY extension?

A

It denotes Python script files

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

What is the command to perform a silent installation of an EXE file in a batch script?

A

C:\Path\to\installer.exe /S

20
Q

What command is used to install Windows updates from a batch file?

21
Q

True or False: A logical test in scripting resolves to a TRUE or FALSE value.

22
Q

Complete the sentence: A script can be set to run automatically using _______.

A

Windows Task Scheduler or cron

23
Q

What command in PowerShell is used to create a new drive mapping?

A

New-PSDrive

24
Q

What is the purpose of error handling in scripts?

A

To anticipate and manage potential errors during execution

25
What is the syntax used to comment a line in a Bash script?
# Comment text
26
What scripting environment is recommended for Windows PowerShell?
Windows PowerShell Integrated Scripting Environment (ISE)
27
What command is used to check if a drive letter is already mapped in PowerShell?
Test-Path
28
What operator is used to test if two conditions are equal in scripting?
== or -eq
29
What is a common use of the 'Until' loop in Bash?
To repeat a block until a condition is met
30
What cmdlet returns properties of network adapters in Windows PowerShell?
Get-NetAdapter
31
Which cmdlet in PowerShell returns log data?
Get-WinEvent
32
What is the purpose of piping results to Where-Object and Select-Object in PowerShell?
To apply filters to the results
33
Which command in Bash is used to filter text output?
grep
34
Fill in the blank: The command 'printf Processes run by $1 on $(date +%F) at $(date +%T) >> ps-$1.log' is used to _______.
log process information by username
35
What is a potential risk when deploying any type of code?
Introducing vulnerabilities
36
True or False: Enabling a non-default interpreter expands the attack surface.
True
37
What could happen if a threat actor modifies the source code of a script?
It could act as malware
38
What is one way a script could inadvertently cause a denial of service (DoS)?
Accidentally powering off a system
39
What should be done to script source code to prevent unauthorized changes?
Subject it to access and version controls
40
What type of mistakes can lead to mishandling of resources in a script?
Coding mistakes
41
Fill in the blank: Scripts that weaken security configurations are _______.
not safe enough to consider running
42
What is a common example of a resource mishandling in scripts?
Creating files that deplete disk storage resources
43
What identifier can you use to refer to the IP address passed to a Bash script as an argument?
$1
44
What type of construct might you use to ensure a script runs without errors when mapping a drive?
Error handling construct
45
Before deploying a script to scan server hosts for open ports, what should you consider?
Potential impact on system performance and security
46
What is a best practice to follow before deploying scripts?
Test all code in a development environment
47
What should be monitored during script execution?
Any bugs that were not found in the test phase