Skip to main content
Get File
Updated over 2 weeks ago

Command

Get-File

Description

The command to get a file from a SharePoint list or from a file share.

Examples

Get File Share file

Get-File -Path "G:\MyFile.txt"Title    : MyFile.txt
FileType : FileShare
List     :
Address  : file:///G:/MyFile.txt
Web      :

Get SharePoint file

$srcSite = Connect-Site -Url "http://myfarm1/sites/mysitecollection"
$srcList = Get-List -site $srcSite -name "MyList"
Get-File -List $srcList -Path "MyFolder/MyFile.txt"Title    : MyFile.txt
FileType : SharePoint
List     : Sharegate.Automation.Entities.List
Address  : http://myfarm1/sites/mysitecollection/MyList/MyFolder/MyFile.txt
Web      : Sharegate.Infrastructure.Models.SharePoint.SGWeb

Syntax

Get-File-List <List> 
-Path <Uri>
Get-File-Path <Uri>

Parameters

-List <List>

Specifies the SharePoint list.

Required?

True

Default value

None

Accept pipeline input?

True (ByValue)

Accept wildcard characters?

False

Parameter set name

SharePoint

Aliases

None

-Path <Uri>

Specifies the relative path from the SharePoint list.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

Did this answer your question?