Comment on page
Send an object content to the client
Out-Download -InputObject <Object> [-ContentType <String>] [-Name <String>]
The cmdlet allows to send content of an object (FileInfo, Stream, String, String or Byte) to the client. This is used for example by report scripts to send the report in HTML, Json or Excel without saving the content of the object to the disk drive. You can specify an object type and file name to make sure the downloaded file is interpreted properly by the browser.
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions
Object content to be sent to the client. Object must be of one of the following types:
The MIME content type of the object. In most cases you can skip this parameter and still have the content type be deduced by the browser from the
Common examples (after Wikipedia)
Name of the file you want the user browser to save the object as.
The input type is the type of the objects that you can pipe to the cmdlet.
The output type is the type of the objects that the cmdlet emits.
Help Author: Adam Najmanowicz, Michael West
Send first log file to the user
Get-Item "$SitecoreLogFolder\*.*" | select -first 1 | Out-Download
Send Hello World text file to the user
"Hello World!" | Out-Download -Name hello-world.txt
Get a list of sitecore branches under root item in the master database and send the list to user as excel file
Import-Function -Name ConvertTo-Xlsx
[byte]$outobject = Get-ChildItem master:\ |
Select-Object -Property Name, ProviderPath, Language, Varsion |
Out-Download -Name "report-$datetime.xlsx" -InputObject $outobject