nerdexam
CompTIA

220-1002 · Question #223

Which of the following file types should be opened when executing a PowerShell script?

The correct answer is D. .ps1. PowerShell scripts use the .ps1 file extension. To execute a PowerShell script, the file must have this extension and be run via the PowerShell interpreter (powershell.exe or pwsh.exe). .bat is for Windows Command Prompt batch scripts, .vbs is for VBScript, .sh is for…

Hardware

Question

Which of the following file types should be opened when executing a PowerShell script?

Options

  • A.bat
  • B.vbs
  • C.sh
  • D.ps1
  • E.psd

How the community answered

(32 responses)
  • B
    3% (1)
  • C
    3% (1)
  • D
    94% (30)

Explanation

PowerShell scripts use the .ps1 file extension. To execute a PowerShell script, the file must have this extension and be run via the PowerShell interpreter (powershell.exe or pwsh.exe). .bat is for Windows Command Prompt batch scripts, .vbs is for VBScript, .sh is for Unix/Linux shell scripts, and .psd (actually .psd1) is a PowerShell data file used for module manifests, not executable scripts.

Topics

#PowerShell#.ps1 extension#scripting#Windows automation

Community Discussion

No community discussion yet for this question.

Full 220-1002 Practice