XML SetInputs.xml conversion error

Jun 11, 2010 at 9:35 PM

I've placed the files in the proper locations and have edited the files as instructed, but I can't get passed this error.  Searching on the internet it seems like an encoding issue, but I've used them all and still can't find the error.  Has anybody else had this issue?

Here is the error:

- Using standard Input File.
- Checking for Powershell 2.0...
- OK.
Transcript started, output file is C:\Users\SVC_SP_Admin\Desktop\AutoSPInstalle
- Reading Input File D:\SP2010\Scripted\\SetInputs.xml...
Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". Error:
 "An error occurred while parsing EntityName. Line 25, position 24."
At D:\SP2010\Scripted\AutoSPInstaller.ps1:22 char:18
+ $xmlinput = [xml] <<<<  (get-content $InputFile)
    + CategoryInfo          : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException

You cannot call a method on a null-valued expression.
At D:\SP2010\Scripted\AutoSPInstaller.ps1:25 char:52
+ $id                                           = $item.getAttribute <<<< ("id"
    + CategoryInfo          : InvalidOperation: (getAttribute:String) [], Runt
    + FullyQualifiedErrorId : InvokeMethodOnNull

 - DB server not specified, so assuming local server SQL instance.
| Automated SP2010 install script |
| Started on: 06/11/2010 14:27:12 |
- SharePoint 2010 RTM (14.0.4755.1000) installer detected.
- This script should be executed using the  credentials.
- (Otherwise, database objects will have inconsistent owners)
- Exiting...
Press any key to exit...

Jun 12, 2010 at 1:14 AM

Hmm can you confirm that the first 3 lines of your SetInputs.xml are (exactly):

<?xml version="1.0" ?>
  <Farm id="1">

The script expects these as-is... looks like $item is coming back null in your case for some reason.

Jun 14, 2010 at 1:51 PM

I figured out the problem.  One of my passwords in the file had an &, and I didn't escape it out thus making the syntax invalid.  Once I fixed that, all went well.

Sep 10, 2012 at 5:28 PM

Oh my goodness. Thank you for posting this. Just spent all this time trying to figure out why a script worked in one environment, but not in another. We had two passwords with & in them in the new environment!