Skip to content

Instantly share code, notes, and snippets.

@michaellwest
Last active August 29, 2015 14:23
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 michaellwest/6c150c1344e86533e61f to your computer and use it in GitHub Desktop.
Save michaellwest/6c150c1344e86533e61f to your computer and use it in GitHub Desktop.
The following downloads images from the media library in the master db and dynamically detects the file extension.
# The following downloads an item from the media library in the master db and dynamically detects the file extension.
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://remotesitecore
Receive-MediaItem -Session $session -Path "/sitecore/media library/Images/Icons/accuracy" -Destination C:\Images\ -Force
# The following downloads all the items from the media library in the specified path.
$session = New-ScriptSession -Username admin -Password b -ConnectionUri http://remotesitecore
Invoke-RemoteScript -Session $session -ScriptBlock {
Get-ChildItem -Path "master:/sitecore/media library/Images/" | Select-Object -Expand ItemPath
} | Receive-MediaItem -Session $session -Destination C:\Temp\Images\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment