SecurityPolicyDsc icon indicating copy to clipboard operation
SecurityPolicyDsc copied to clipboard

Comments cause Index operation failed; the array index evaluated to null.

Open jachin84 opened this issue 7 years ago • 1 comments

I have a template that has a comment section up the top that is as follows:

;This Security Template provides settings to support the setting recommendations 
;in the security guides. Please read the entire contents of the appropriate
;security guide before using this template.

;Copyright (c) 2008 Microsoft Corporation. All rights reserved. Complying with the applicable copyright laws is your responsibility.  By using or providing feedback on this documentation, you agree to the license agreement below.
;If you are using this documentation solely for non-commercial purposes internally within YOUR company or organization, then this documentation is licensed to you under the Creative Commons Attribution-NonCommercial License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
;This documentation is provided to you for informational purposes only, and is provided to you entirely "AS IS".  Your use of the documentation cannot be understood as substituting for customized service and information that might be developed by Microsoft Corporation for a particular user based upon that user��s particular environment. To the extent permitted by law, MICROSOFT MAKES NO WARRANTY OF ANY KIND, DISCLAIMS ALL EXPRESS, IMPLIED AND STATUTORY WARRANTIES, AND ASSUMES NO LIABILITY TO YOU FOR ANY DAMAGES OF ANY TYPE IN CONNECTION WITH THESE MATERIALS OR ANY INTELLECTUAL PROPERTY IN THEM.  
;Microsoft may have patents, patent applications, trademarks, or other intellectual property rights covering subject matter within this documentation.  Except as provided in a separate agreement from Microsoft, your use of this document does not give you any license to these patents, trademarks or other intellectual property.
;Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious.   
;Microsoft and the Microsoft product names listed in this data file are trademarks of the Microsoft group of companies; the list of Microsoft trademarks can be found at http://www.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx
;The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
;You have no obligation to give Microsoft any suggestions, comments or other feedback ("Feedback") relating to the documentation. However, if you do provide any Feedback to Microsoft then you provide to Microsoft, without charge, the right to use, share and commercialize your Feedback in any way and for any purpose.  You also give to third parties, without charge, any patent rights needed for their products, technologies and services to use or interface with any specific parts of a Microsoft software or service that includes the Feedback.  You will not give Feedback that is subject to a license that requires Microsoft to license its software or documentation to third parties because we include your Feedback in them.

The commend block causes a large number of the following error:

Index operation failed; the array index evaluated to null.
At C:\Program Files\WindowsPowerShell\Modules\SecurityPolicyDsc\2.1.0.0\DSCResources\SecurityPolicyResourceHelper\Secur
ityPolicyResourceHelper.psm1:155 char:13
+             $policyConfiguration[$section][$name] = $value
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArrayIndex

jachin84 avatar Jun 06 '18 00:06 jachin84

Can you provide an example of the configuration you are using?

There should be a regression unit test testing for this issue as well. Labeling this as an enhancement and help wanted so anyone in the community can run with this.

johlju avatar Jun 06 '18 13:06 johlju