Thanks Glen, that worked great! I just had to add extra $'s in the string for variable declarations.

$CmdString = 'Dim $' + $key + @CRLF + '$' + $key + '=' + $Value