A colleague sends Priya a maintenance script named diskcleanup.ps1 to run on a Windows 11 workstation. Which scripting environment is this file designed for?
- AThe Windows Command Prompt, which executes legacy batch instructions line by line.
- BA Unix or Linux Bash shell, which runs plain shell script files directly.
- CThe Python interpreter, which executes interpreted source code at runtime.
- DWindows PowerShell, whose scripts use the .ps1 file extension. Correct
Why A is wrong: Command Prompt runs batch files, but those carry a .bat or .cmd extension, not .ps1, so this environment does not match the file.
Why B is wrong: Bash is a real interpreter, but shell scripts use the .sh extension and Bash is not native to a standard Windows workstation.
Why C is wrong: Python is a genuine interpreted language, but its scripts use the .py extension and require Python to be installed separately.
Why D is correct: A .ps1 file is a PowerShell script and is interpreted by the PowerShell engine, so this is the correct environment for it.