Create a hash table pairing each key with its corresponding value from two arrays.
Step 2: Analyze each option
$hash = @{}; for ($i=0; $i -lt $keys.Length; $i++) { $hash[$keys[$i]] = $values[$i] } uses a loop to assign each key to its value correctly. Options A, B, and D do not create a proper hash table.
Final Answer:
$hash = @{}; for ($i=0; $i -lt $keys.Length; $i++) { $hash[$keys[$i]] = $values[$i] } -> Option C
Quick Check:
Use loop to assign keys and values to hash table [OK]
Quick Trick:Use a loop to assign keys and values to hash table [OK]
Common Mistakes:
Trying to combine arrays directly
Using invalid hash table syntax
Not looping through arrays
Master "Variables and Data Types" in PowerShell
9 interactive learning modes - each teaches the same concept differently