external help file | applicable | schema |
---|---|---|
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online |
2.0.0 |
Returns a folder from a given site relative path, and will create it if it does not exist.
Ensure-PnPFolder -SiteRelativePath <String>
[-Web <WebPipeBind>]
[-Includes <String[]>]
[-Connection <SPOnlineConnection>]
If you do not want the folder to be created, for instance just to test if a folder exists, check Get-PnPFolder
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.
Specify properties to include when retrieving objects from the server.
Type: String[]
Parameter Sets:
Required: False
Position: 0
Accept pipeline input: False
Site Relative Folder Path
Type: String
Parameter Sets: (All)
Required: True
Position: 0
Accept pipeline input: False
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
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