A systems administrator is auditing administrative scripts across a heterogeneous corporate network. Match each script code snippet or syntax requirement on the left to its correct scripting language environment, file extension, and execution rule on the right.
- A script snippet referencing `$env:COMPUTERNAME` and using `Get-ChildItem -Path C:\Logs` to process system events.PowerShell (`.ps1`) script executing within standard .NET-backed shell host environments.
- A script snippet using `%SYSTEMROOT%` environment variables with `IF EXIST` conditional syntax and `REM` for documentation lines.Windows Batch (`.bat` / `.cmd`) script executing within the command processor (`cmd.exe`).
- A script snippet starting with `#!/bin/bash`, utilizing `$1` for positional input arguments and `#` for inline comments.Bash Shell (`.sh`) script executing within Unix/Linux or macOS terminal environments.
- A legacy automation script using `WScript.Echo` to prompt users, using a single quote `'` for comments and execution via `cscript.exe`.VBScript (`.vbs`) executing via the Windows Script Host runtime engine.
Answer
The script snippet using ` 1` matches Bash Shell (`.sh`). The script using `WScript.Echo` and single quote comments matches VBScript (`.vbs`).
Each script snippet relies on unique syntax constructs and execution environments defined in CompTIA A+ Core 2 objectives: PowerShell uses `$env:` and cmdlets (`.ps1`); Batch uses `%VAR%` and `REM` (`.bat`); Bash uses shebang directives `#!/bin/bash` and `#` comments (`.sh`); VBScript uses `WScript` runtime objects and single-quote comments (`.vbs`).
Step-by-Step Solution
Key Concept
Basic Scripting Languages, File Extensions, and Environmental Syntax