nerdexam
CompTIA

220-1002 · Question #810

A technician sees the following in a .ps1 file: Which of the following BEST describes the lines that start with the # symbol?

The correct answer is B. Comments. In PowerShell (.ps1 files) and most scripting/programming languages, lines beginning with the # symbol are comments. Comments are non-executable text ignored by the interpreter at runtime. They are used by developers to document code, explain logic, or temporarily disable…

Hardware and network troubleshooting

Question

A technician sees the following in a .ps1 file:

Which of the following BEST describes the lines that start with the # symbol?

Options

  • ABasic loops
  • BComments
  • CIntegers
  • DEnvironment variables

How the community answered

(68 responses)
  • A
    4% (3)
  • B
    91% (62)
  • C
    3% (2)
  • D
    1% (1)

Explanation

In PowerShell (.ps1 files) and most scripting/programming languages, lines beginning with the # symbol are comments. Comments are non-executable text ignored by the interpreter at runtime. They are used by developers to document code, explain logic, or temporarily disable lines. They are not loops (which use keywords like for, while, foreach), integers (numeric values), or environment variables (which use $env: in PowerShell). Recognizing comment syntax is a fundamental scripting literacy skill tested on CompTIA A+.

Topics

#PowerShell#scripting syntax#comments#ps1 file

Community Discussion

No community discussion yet for this question.

Full 220-1002 Practice