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…
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)- B3% (1)
- C3% (1)
- D94% (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
Community Discussion
No community discussion yet for this question.