Skip to content

Latest commit

 

History

History
89 lines (65 loc) · 2.04 KB

Ensure-PnPFolder.md

File metadata and controls

89 lines (65 loc) · 2.04 KB
external help file applicable schema
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online
2.0.0

Ensure-PnPFolder

SYNOPSIS

Returns a folder from a given site relative path, and will create it if it does not exist.

SYNTAX

Ensure-PnPFolder -SiteRelativePath <String>
                 [-Web <WebPipeBind>]
                 [-Includes <String[]>]
                 [-Connection <SPOnlineConnection>]

DESCRIPTION

If you do not want the folder to be created, for instance just to test if a folder exists, check Get-PnPFolder

EXAMPLES

------------------EXAMPLE 1------------------

PS:> Ensure-PnPFolder -SiteRelativePath "demofolder/subfolder"

Creates a folder called subfolder in a folder called demofolder located in the root folder of the site. If the folder hierarchy does not exist, it will be created.

PARAMETERS

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: 

Required: False
Position: 0
Accept pipeline input: False

-SiteRelativePath

Site Relative Folder Path

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by cmdlet. Retrieve the value for this parameter by eiter specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: SPOnlineConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

RELATED LINKS

SharePoint Developer Patterns and PracticesGet-PnPFolder