Skip to content

Instantly share code, notes, and snippets.

@patelcp
Forked from michaellwest/RemotelyDownloadFile.ps1
Created December 29, 2017 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patelcp/5dcd5a68e6d468061ea574fbf584ae24 to your computer and use it in GitHub Desktop.
Save patelcp/5dcd5a68e6d468061ea574fbf584ae24 to your computer and use it in GitHub Desktop.
Read all bytes of a file from the Sitecore PowerShell Extensions remoting service.
Import-Module -Name SPE
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://console
$bytes = Invoke-RemoteScript -Session $session -ScriptBlock {
[System.IO.File]::ReadAllBytes("$($SitecoreDataFolder)packages\SPE Remoting-3.1.zip")
}
[System.IO.File]::WriteAllBytes("C:\temp\SPE Remoting-3.1.zip", $bytes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment