Question

Difficulty: MediumBasic Scripting Languages and Constructs

An IT administrator is organizing administrative automation tools across a multi-platform corporate environment. Match each script file extension on the left with its primary execution environment or runtime characteristics on the right.

  • .ps1Executes natively in the Windows PowerShell environment using object-based cmdlets for administrative tasks.
  • .shExecutes within Unix/Linux and macOS shell environments, frequently defined with a shebang line like #!/bin/bash.
  • .vbsExecutes via the Windows Script Host (WSH) engine, traditionally utilized for legacy COM component automation.
  • .pyExecutes across multiple operating systems using an installed language interpreter, offering cross-platform capabilities.

Answer

.ps1 matches with native Windows PowerShell cmdlet execution; .sh matches with Unix/Linux/macOS shell environments; .vbs matches with Windows Script Host (WSH) execution; .py matches with cross-platform Python interpreter execution.
Each script extension maps directly to its operational environment: .ps1 belongs to Windows PowerShell, .sh to Linux/macOS shell environments, .vbs to Windows Script Host (WSH), and .py to cross-platform Python interpreters.

Step-by-Step Solution

1
Identify the primary runtime environment for .ps1 scripts.
PowerShell scripts (.ps1) run in the Windows PowerShell environment using cmdlets.
CompTIA A+ Core 2 identifies .ps1 as the standard extension for Windows PowerShell scripts.
2
Identify the primary runtime environment for .sh scripts.
Shell scripts (.sh) run in Unix-like environments (Linux/macOS bash/sh).
The .sh extension denotes shell scripts executing in Linux or macOS terminals.
3
Identify the primary runtime environment for .vbs scripts.
VBScript (.vbs) files are executed by Windows Script Host (WSH).
Windows Script Host is the execution engine for VBScript and JScript in Windows.
4
Identify the primary runtime environment for .py scripts.
Python (.py) scripts require a Python interpreter to run across platforms.
Python is a cross-platform language relying on an installed interpreter regardless of OS.

Key Concept

Basic Scripting Languages and File Extensions
Rate this question