Share via


SharePoint Online SPOMod: Set-SPOFileCheckout

This article describes a function of a custom SharePoint Online module available for download and installation here.

Set-SPOFileCheckout

Checks out a file.

Parameters

ServerRelativeUrl  Mandatory  Relative url of the file.

 

Examples

----- EXAMPLE 1 ------
Check out a single file.

Set-SPOFileCheckout -ServerRelativeUrl "/sites/TeamsiteWithLibraries/uyyu/u8/fold3/u8 - CaptureYokoGroupCool2.PNG"

----- EXAMPLE 2 ------
Check out all files in a list (throws errors for folders and already checked-out files).

$filerefs=(Get-SPOListItems uyyu -Recursive -IncludeAllProperties $true).FileRef
foreach($filref in $filerefs){Write-Host $filref; Set-SPOFileCheckout -ServerRelativeUrl $filref}

----- EXAMPLE 3 ------
Check out all files from a specific folder. The example below targets files from folder called** fold3,** located in a Document Set u8, inside a list UYYU, which is in TeamsiteWithLibraries site collection.

$serverurls=(Get-SPOFolderFiles -ServerRelativeUrl "/sites/teamsitewithlibraries/uyyu/u8/fold3").ServerRelativeUrl
 foreach($filref in $serverurls){ Set-SPOFileCheckout -ServerRelativeUrl $filref}


  

See Also

SPOMod Cmdlets and Resources 
Connect-SPOCSOM
Get-SPOList
Approve-SPOFile
Set-SPOFileCheckin