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.
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)- A89% (16)
- D6% (1)
- E6% (1)
Why each option
The standard file extension for a PowerShell script is .ps1.
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.
.py is the file extension for Python scripts.
.sh is the file extension for shell scripts, commonly used in Unix-like operating systems.
.bat is the file extension for batch files, primarily used with Windows Command Prompt.
.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
Community Discussion
No community discussion yet for this question.