Question

Difficulty: MediumBasic Scripting Languages and Constructs

An IT technician is organizing administrative automation scripts used across Windows and Linux workstations. Match each scripting language environment on the left with its corresponding syntax characteristic or execution feature on the right.

  • PowerShell Script (.ps1)Uses $env:VAR syntax for environment variables and natively supports cmdlets for system object management.
  • Windows Batch Script (.bat)Uses %VAR% syntax for environment variables and REM or :: for line comments.
  • VBScript (.vbs)Leverages WScript.Echo for output and is executed via Windows Script Host (CScript or WScript).
  • Bash Shell Script (.sh)Starts with a shebang line (#!/bin/bash) and uses standard Unix environment variable references like $VAR.

Answer

PowerShell (.ps1) matches env:VARsyntaxandcmdlets;WindowsBatch(.bat)matchesenv:VAR syntax and cmdlets; Windows Batch (.bat) matches %VAR% syntax and REM comments; VBScript (.vbs) matches WScript.Echo and Windows Script Host execution; Bash (.sh) matches shebang (#!/bin/bash) and VAR syntax.
Each scripting language and file extension featured in CompTIA A+ Core 2 has distinct variable naming conventions, runtime interpreters, and comment structures that differentiate them during administrative automation.

Step-by-Step Solution

1
Identify the environment variable notation and object model associated with Windows PowerShell.
PowerShell scripts (.ps1) utilize $env:VAR to access environment variables and execute native cmdlets.
PowerShell is designed for task automation and object-based administration in modern Windows operating systems.
2
Identify the legacy Windows command processor scripting syntax.
Batch scripts (.bat) enclose environment variables in percent signs (%VAR%) and use REM or double colons for comment lines.
Batch scripting follows syntax conventions from MS-DOS and CMD.exe.
3
Identify the host environment and output syntax for VBScript.
VBScript (.vbs) uses WScript.Echo for console/dialog output and runs under Windows Script Host (CScript/WScript).
VBScript is a legacy Windows administrative language executed by Windows Script Host binaries.
4
Identify Linux/Unix shell script initialization and syntax conventions.
Bash scripts (.sh) begin with a shebang path (#!/bin/bash) and reference environment variables using a dollar sign prefix ($VAR).
Bash scripts require the shebang line to instruct the OS kernel which interpreter to invoke upon execution.

Key Concept

Basic Scripting Languages, File Extensions, Syntax, and Runtime Environments
Rate this question