Runtime Exception with AutoSPInstallerMain.ps1

Sep 29, 2011 at 8:31 PM

I am trying to use AutoSPInstaller to install SharePoint Foundation 2010. I commented out the services in the input file that are not available for Foundation but get a runtime exception when running AutoSPInstallerLaunch.bat as administrator.

Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". Error:
 "An XML comment cannot contain '--', and '-' cannot be the last character. Lin
e 222, position 11."
At C:\SP2010\AutoSPInstaller\AutoSPInstallerMain.ps1:8 char:15
+ [xml]$xmlinput <<<<  = (Get-Content $InputFile) -replace ("localhost", $env:C
OMPUTERNAME)
    + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMet
   adataException
    + FullyQualifiedErrorId : RuntimeException


Security Warning
Run only scripts that you trust. While scripts from the Internet can be useful,
 this script can potentially harm your computer. Do you want to run
C:\SP2010\AutoSPInstaller\AutoSPInstallerFunctions.ps1?
[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"):

Line 222 is in the "Catch" section of the code. Is there something I'm supposed to add to the AutoSPInstallerMain.ps1 script? 

 

Sep 29, 2011 at 9:34 PM

The issue is in how you are doing the commenting in XML.

Sep 29, 2011 at 9:37 PM

I opened the xml in Notepad++ and start the comment with <!-- and end with -->. Isn't that the normal way? The lines turn green like the rest of the commented lines.

Sep 29, 2011 at 9:48 PM

Ok that was it. I had commented out entire groupings and had to comment out the sections within the groups. Thanks for the quick help!