- A
Store the script in a hidden folder
Why wrong: Hidden folders are easily discovered and do not prevent modification.
- B
Set the script file to read-only
Why wrong: Read-only can be bypassed by an attacker with write permissions; it is not a strong security control.
- C
Use a digital signature to sign the script and enforce execution policy
Signing ensures integrity; if the script is modified, the signature becomes invalid and execution is blocked.
- D
Compile the script into an executable
Why wrong: Compiling does not prevent modification; an attacker could still replace the executable.
Quick Answer
The correct answer is to use a digital signature to sign the script and enforce an execution policy. This works because a digital signature cryptographically binds the script’s content to its author; if an attacker modifies even a single character of the script, the signature becomes invalid. The execution policy, when set to AllSigned or RemoteSigned, then blocks the tampered script from running, preventing the malicious commands from executing. On the CompTIA A+ Core 2 220-1202 exam, this scenario tests your understanding of how execution policies enforce script integrity, often appearing as a contrast to simple file permissions or antivirus solutions—a common trap is assuming read-only permissions alone would stop the attack. Remember the mnemonic “Sign to Shine”: a valid signature proves the script hasn’t been shadowed by tampering, and the policy enforces that shine.
220-1102 Scripting Basics Practice Question
This 220-1202 practice question tests your understanding of scripting basics. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A security incident occurred where an attacker modified a PowerShell script on a file server to include malicious commands. The script is executed daily by a scheduled task. Which scripting security best practice could have prevented this attack?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue:
"best"Why it matters: Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Use a digital signature to sign the script and enforce execution policy
Option C is correct because enforcing an execution policy that requires scripts to be digitally signed ensures that only scripts signed by a trusted publisher can run. If the attacker modified the script, the digital signature would become invalid, and the execution policy would block the script from running, preventing the malicious commands from executing.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Store the script in a hidden folder
Why it's wrong here
Hidden folders are easily discovered and do not prevent modification.
- ✗
Set the script file to read-only
Why it's wrong here
Read-only can be bypassed by an attacker with write permissions; it is not a strong security control.
- ✓
Use a digital signature to sign the script and enforce execution policy
Why this is correct
Signing ensures integrity; if the script is modified, the signature becomes invalid and execution is blocked.
Clue confirmation
The clue word "best" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Compile the script into an executable
Why it's wrong here
Compiling does not prevent modification; an attacker could still replace the executable.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often choose 'Set the script file to read-only' because they think file permissions alone are sufficient, but Cisco tests that integrity verification (via digital signatures) is the only way to detect unauthorized modifications in a script that is executed automatically.
Detailed technical explanation
How to think about this question
PowerShell's execution policy (e.g., AllSigned or RemoteSigned) uses digital signatures based on Authenticode, which relies on a certificate chain to verify the script's publisher and integrity. When a script is signed, a hash of the script is encrypted with the signer's private key; any modification breaks the hash, causing PowerShell to reject the script even if the file is renamed or moved. In a real-world scenario, an attacker who gains write access to the file server could still modify a signed script, but the execution policy would block it, forcing the attacker to either steal the signing certificate or disable the policy, which would generate security logs.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A small business has 20 workstations on the 192.168.1.0/24 network and one public IP from its ISP. The router uses PAT (NAT overload) so all 20 devices share one public address using different source ports. NAT questions test whether you understand the four address terms and which direction each translation applies.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Scripting Basics — study guide chapter
Learn the concepts, then practise the questions
- →
Scripting Basics practice questions
Targeted practice on this topic area only
- →
All 220-1202 questions
750 questions across all exam domains
- →
CompTIA A+ Core 2 220-1202 study guide
Full concept coverage aligned to exam objectives
- →
220-1202 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related 220-1202 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Windows OS Features and Tools practice questions
Practise 220-1202 questions linked to Windows OS Features and Tools.
Windows Settings and Control Panel practice questions
Practise 220-1202 questions linked to Windows Settings and Control Panel.
Windows Command-Line Tools practice questions
Practise 220-1202 questions linked to Windows Command-Line Tools.
Windows Administrative Tools practice questions
Practise 220-1202 questions linked to Windows Administrative Tools.
macOS Features and Tools practice questions
Practise 220-1202 questions linked to macOS Features and Tools.
Linux Commands and File Permissions practice questions
Practise 220-1202 questions linked to Linux Commands and File Permissions.
Mobile OS Features and Tools practice questions
Practise 220-1202 questions linked to Mobile OS Features and Tools.
Virtualization and Cloud Technologies practice questions
Practise 220-1202 questions linked to Virtualization and Cloud Technologies.
Physical Security Controls practice questions
Practise 220-1202 questions linked to Physical Security Controls.
Logical Security Concepts practice questions
Practise 220-1202 questions linked to Logical Security Concepts.
Wireless Security Protocols practice questions
Practise 220-1202 questions linked to Wireless Security Protocols.
Malware Types and Removal practice questions
Practise 220-1202 questions linked to Malware Types and Removal.
Practice this exam
Start a free 220-1202 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this 220-1202 question test?
Scripting Basics — This question tests Scripting Basics — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Use a digital signature to sign the script and enforce execution policy — Option C is correct because enforcing an execution policy that requires scripts to be digitally signed ensures that only scripts signed by a trusted publisher can run. If the attacker modified the script, the digital signature would become invalid, and the execution policy would block the script from running, preventing the malicious commands from executing.
What should I do if I get this 220-1202 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "best". Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 24, 2026
This 220-1202 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 220-1202 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.