none
Issue with export-spweb if run it in invoke-command RRS feed

  • Question

  • Hi all.

    Trying to make replication of some folders, lists and etc..

    Trying to run Export-spweb in invoke-command and get this error:

    Invoke-Command-Computer"spfe01.contoso.loc"-ScriptBlock{

    Add-PSSnapinMicrosoft.SharePoint.PowerShell# -ErrorAction SilentlyContinue

    $web="https://portal.contoso.loc/IT/Microsoft"

    #$section="lists\Tasks"

    Export-SPWeb$web-Path"c:\temp\microsoft-tasks123sasdssss.cmp"-IncludeVersionsall-CompressionSize50-IncludeUserSecurity-force# -ItemUrl $section

    }

    Cannot find an SPWeb object with Id or Url : https://portal.contoso.loc/IT/Microsoft.

    + CategoryInfo : InvalidData: (Microsoft.Share...CmdletExportWeb:SPCmdletExportWeb) [E

    xport-SPWeb], SPCmdletPipeBindException

    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletExportWeb

    + PSComputerName : spfe01.internal.dreamscapenetworks.com

    When i run this command directly on "spfe01.contoso.loc" - all works fine. Tried use -credential$credential but didn't help.

    Any advice?

    Wednesday, January 20, 2016 2:42 PM

Answers