microsoft / BaselineManagement

Conversion tool used to Convert Group Policy baselines into DSC
MIT License
266 stars 52 forks source link

DSC Import From GPO Index null #12

Closed Raphdeumax closed 4 years ago

Raphdeumax commented 7 years ago

Hi, When i use ConvertFrom-GPO -Path "E:\DSC\GPO\{7db8ad33-c727-46a5-a576-0a1277fb79d0}" the index of the ini section appear to null.

Index operation failed; the array index evaluated to null.
At C:\Program Files\WindowsPowerShell\Modules\BaselineManagement\2.4.5000\Helpers\Functions.ps1:493 char:13
+             $ini[$section][$name] = $value.Trim()
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArrayIndex

Thanks ;-)

bobbytreed commented 5 years ago

I'm guessing this was because the comment was at the top of the file (and thus not in a section), if you have any sample ini content (with sensitive data removed), I can fix it :-)