0

I'm trying to install and update package through powershell, below is the script. session is successfully created, but when invoking a remote script, I'm getting an error.

Script:

$file = "C:\inetpub\wwwroot\Test\Data\SitecorePackageDeployer\SampleTDSProject.update"
$session = New-ScriptSession -Username prem -Password **** -ConnectionUri http://test
$scriptBlock = [scriptblock]::Create("Start-ScriptSession -ScriptBlock {Install-UpdatePackage -Path $file -UpgradeAction Upgrade -InstallMode Update ; Start-Sleep -Seconds 10; [PSCustomObject]@{'IsComplete'=$true}}")
$job = Invoke-RemoteScript -Session $session -ScriptBlock $scriptBlock

Error:

Exception calling "Invoke" with "1" argument(s): "Element 'Objs' with namespace name 'http://schemas.microsoft.com/powershell/2004/04' was not found. Line 3, position 2."
At C:\Program Files\WindowsPowerShell\Modules\SPE\5.1.0\ConvertFrom-CliXml.ps1:22 char:9
+         $deserializer = $ctor.Invoke($xr)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : XmlException

Exception calling "InvokeMember" with "5" argument(s): "Non-static method requires a target."
At C:\Program Files\WindowsPowerShell\Modules\SPE\5.1.0\ConvertFrom-CliXml.ps1:24 char:16
+ ...      while (!$type.InvokeMember("Done", "InvokeMethod,NonPublic,Insta ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : TargetException

enter image description here

  • My fix was to downgrade to Sitecore SPE 5.0. I Hope it will be fixet asap – JonasVeng Jul 17 at 8:39
  • Can you provide the details of which version of SPE and SPE Remoting packages you used? – Michael West Jul 17 at 19:39
1

The issue is most likely related to the fact you are using incompatible versions of the SPE Remoting package and SPE.

  • If you are using SPE 5.1 then you should be using SPE Remoting 5.1.
  • If you are using SPE 5.0 then you should be using SPE Remoting 5.0 (or 5.0.1).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.