Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". Error: "Unexpected XML d eclaration. The XML declaration must be the first node in the document, and no white space charac ters are allowed to appear before it. Line 1, position 7." At R:\Scripts\script.ps1:126 char:1 + [xml]$xml = gc $configuration -enc utf8 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: ( [], RuntimeException + FullyQualifiedErrorId : InvalidCastToXmlDocument The variable cannot be validated because the value is not a valid value for the number variable. At R:\Scripts\script.ps1:130 char:1 + $substitute,$number = $xml.root.configuration.substitute,$xml.root.configuration ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : MetadataError: ( [], ValidationMetadataException + FullyQualifiedErrorId : ValidateSetFailure Get-Item : Cannot bind argument to parameter 'Path' because it is null. At R:\Scripts\script.ps1:134 char:15 + $pth = gi $_ -force + ~~ + CategoryInfo : InvalidData: ( [Get-Item], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShel l.Commands.GetItemCommand Test-Path : Cannot bind argument to parameter 'Path' because it is null. At R:\Scripts\script.ps1:135 char:18 + if(test-path $pth.fullname -patht container){ + ~~~~~~~~~~~~~ + CategoryInfo : InvalidData: ( [Test-Path], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShel l.Commands.TestPathCommand |