Operational Procedures

A technician saves commands in a file named cleanup.ps1 on a Windows 11 PC. Which environment is designed to run this script?

Show the answer

Correct answerC. PowerShell

AWhy not this: Bash interprets .sh shell scripts on Linux and macOS.

BWhy not this: Windows Script Host runs .vbs and .js files, not PowerShell scripts.

CWhy this is right: PowerShell is the shell and scripting engine that interprets .ps1 files.

DWhy not this: Command Prompt runs .bat files and its own commands, not PowerShell scripts.

The .ps1 extension marks a PowerShell script, which the PowerShell engine interprets. Windows Script Host is tempting because it runs scripts on Windows, but it runs .vbs and .js files, not .ps1 files.