Table of contents
TOC
Collapse the table of content
Expand the table of content

FileFolderExtensions.CreateFolder Method

SharePoint Dev Documents|Last Updated: 5/20/2017
|
1 Contributor

Creates a folder with the given name.

Namespace:Microsoft.SharePoint.Client
Assembly: OfficeDevPnP.Core.dll

Syntax

public static Folder CreateFolder(this Folder parentFolder, String folderName)

Parameters

parentFolder

  Type: Microsoft.SharePoint.Client.Folder
  Parent folder to create under

folderName

  Type: System.String
  Folder name to retrieve or create

Return Value

Type: Folder
The newly created folder

Remarks

Note that this only checks one level of folder (the Folders collection) and cannot accept a name with path characters.

var folder = list.RootFolder.CreateFolder("new-folder");

See also

© 2018 Microsoft