I ran into a dubious error this morning, which I prematurely filed in the but-I-did-exactly-the-same-thing-yesterday-and-it-worked category.
The problem occurred with the following two lines of code, trying to access the Web Services of a Sharepoint 2007 ERP site:
$uri = "https://sitename/_vti_bin/lists.asmx?WSDL" $service = New-WebServiceProxy -Uri $uri -Namespace SpWs -UseDefaultCredential
The resulting error message was
New-WebServiceProxy : Initialization failure. Please review input options and documents for validity.
At Untitled1.ps1:2 char:31
+ $service = New-WebServiceProxy <<<< -Uri $uri -Namespace SpWs -UseDefaultCredential
+ CategoryInfo : NotSpecified: (:) [New-WebServiceProxy], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.NewWebServiceProxy
finding nothing on Google, it took me a while to figure out that copying these lines to a mindmapping tool and back added some control characters which the PowerShell parser was not able to ignore.
Thus, retyping the second line and saving the file as .ps1 solved this issue.
dlvrt
Leave a comment