Bird
0
0

Why does this script fail?

medium📝 Debug Q7 of 15
PowerShell - System Administration
Why does this script fail?
$env:123VAR = 'value'
AVariable names cannot start with a number
BStrings must be in double quotes
CEnvironment variables are read-only
DMissing $ before variable name
Step-by-Step Solution
Solution:
  1. Step 1: Check variable naming rules

    Environment variable names must start with a letter or underscore, not a number.
  2. Step 2: Validate other options

    Strings can be single or double quoted, env vars are writable, and $env: prefix is present.
  3. Final Answer:

    Variable names cannot start with a number -> Option A
  4. Quick Check:

    Env var names must start with letter [OK]
Quick Trick: Env var names must start with letter or underscore [OK]
Common Mistakes:
  • Starting variable names with digits
  • Thinking env vars are read-only
  • Confusing string quoting rules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes