I suspect the actual error comes from the next line in the script
switch ($AdditionalConfiguration.GetEnumerator())
Then the error message about GetEnumerator seems to make sense, but the displayed line is not correct.
I would guess that $AdditionalConfigurationis $null at this point.
Add a line to test for this.
If($AdditionalConfiguration){
Switch ($AdditionalConfiguration.GetEnumerator())
....