PowerShell - System AdministrationWhy does this script fail?$env:123VAR = 'value'AVariable names cannot start with a numberBStrings must be in double quotesCEnvironment variables are read-onlyDMissing $ before variable nameCheck Answer
Step-by-Step SolutionSolution:Step 1: Check variable naming rulesEnvironment variable names must start with a letter or underscore, not a number.Step 2: Validate other optionsStrings can be single or double quoted, env vars are writable, and $env: prefix is present.Final Answer:Variable names cannot start with a number -> Option AQuick 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 digitsThinking env vars are read-onlyConfusing string quoting rules
Master "System Administration" in PowerShell9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PowerShell Quizzes Active Directory - Get-ADUser - Quiz 4medium Active Directory - Group management - Quiz 1easy Automation Patterns - Why automation saves time - Quiz 10hard Automation Patterns - Log cleanup automation - Quiz 12easy Cross-Platform PowerShell - PowerShell on macOS - Quiz 7medium Cross-Platform PowerShell - Why cross-platform extends reach - Quiz 4medium Remote Management - CIM/WMI cmdlets - Quiz 11easy Remote Management - Why remote execution scales management - Quiz 13medium Scripting Best Practices - Parameter validation - Quiz 4medium Scripting Best Practices - Pester testing framework basics - Quiz 10hard