Download-SPOFile

Downloads a specific File from a given Site.

Download-SPOFile -File <SPOFilePipeBind[]> -Web <SPOWebPipeBind> -TargetFolder <String> [-Overwrite [<SwitchParameter>]]

Download-SPOFile -Folder <SPOFolderPipeBind> [-Recursive [<SwitchParameter>]] -Web <SPOWebPipeBind> -TargetFolder <String> [-Overwrite [<SwitchParameter>]]

Parameters

1

ParameterRequiredTypeDescription
FileTrueSPOFilePipeBind[]

The server relative URL(s) to the file(s) to retrieve.

WebTrueSPOWebPipeBind

Specifies the identity of the Site containing the File(s) to retrieve.

The type must be a valid server relative URL, in the form /site_name, or an SPOWeb object, Microsoft.SharePoint.Client.Web object, or GUID representing the Site ID.

TargetFolderTrueString

The path to the folder to save the files to.

OverwriteFalseSwitchParameter

Overwrite existing files.

2

ParameterRequiredTypeDescription
FolderTrueSPOFolderPipeBind

The path to the folder to save.

RecursiveFalseSwitchParameter

Save all child folders and their files.

WebTrueSPOWebPipeBind

Specifies the identity of the Site containing the File(s) to retrieve.

The type must be a valid server relative URL, in the form /site_name, or an SPOWeb object, Microsoft.SharePoint.Client.Web object, or GUID representing the Site ID.

TargetFolderTrueString

The path to the folder to save the files to.

OverwriteFalseSwitchParameter

Overwrite existing files.

Detailed Description

Download and save a specific file from a Site given the server relative URL to the file. The Site provided by the -Web parameter must correspond to the Site where the file is located or else an argument out of range exception will be thrown.

Copyright 2016 Falchion Consulting, LLC

> For more information on this cmdlet and others:

> http://blog.falchionconsulting.com/

> Use of this cmdlet is at your own risk.

> Gary Lapointe assumes no liability.

Examples

------------------EXAMPLE------------------

PS C:\> Download-SPOFile -Web "/" -File "/Shared Documents/MyFile.docx" -TargetFolder "c:\temp" -Overwrite

Downloads the file MyFile.docx from the Documents library within the root Site of the current Site Collection and saves to the c:\temp folder.