nerdexam
CompTIA

220-1102 · Question #490

Which of the following file extensions should a technician use for a PowerShell script?

The correct answer is A. .ps1. The standard file extension for a PowerShell script is .ps1.

Operating Systems

Question

Which of the following file extensions should a technician use for a PowerShell script?

Options

  • A.ps1
  • B.py
  • C.sh
  • D.bat
  • E.cmd

How the community answered

(18 responses)
  • A
    89% (16)
  • D
    6% (1)
  • E
    6% (1)

Why each option

The standard file extension for a PowerShell script is .ps1.

A.ps1Correct

The .ps1 file extension is the recognized and standard extension for PowerShell script files. This extension allows the operating system to associate the script with the PowerShell execution engine, enabling it to run correctly.

B.py

.py is the file extension for Python scripts.

C.sh

.sh is the file extension for shell scripts, commonly used in Unix-like operating systems.

D.bat

.bat is the file extension for batch files, primarily used with Windows Command Prompt.

E.cmd

.cmd is another file extension for batch files, also used with Windows Command Prompt, similar to .bat.

Concept tested: PowerShell script file extensions

Source: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scripts?view=powershell-7.4

Topics

#PowerShell#Scripting#File extensions#Windows administration

Community Discussion

No community discussion yet for this question.

Full 220-1102 Practice