New-WssMsoSharePointLibrary

Creates a sp_online_2 library.

Syntax

New-WssMsoSharePointLibrary
   [-Name] <String>
   [[-Description] <String>]
   [[-LibraryType] <SharePointLibraryType>]
   [[-Site] <SharePointSite>]
   [-EnableVersioning]
   [-ForceCheckout]
   [<CommonParameters>]

Description

The New-WssMsoSharePointLibrary cmdlet creates a sp_online_1 library. A office_365_1 site stores the sp_online_2 library.

Examples

Example 1: Create a SharePoint library

PS C:\> $Site = Get-WssMSOSharePointSite | Select-Object -First 1
PS C:\> New-WssMsoSharePointLibrary -Name "Documents" -Description "SharePoint library used to share documents." -LibraryType "DocumentLibrary" -Site $Site -EnableVersioning
SharePointLibraryType: DocumentLibrary = 101, PictureLibrary = 109, WebPageLibrary = 119

The first command uses the Get-WssMsoSharePointSite cmdlet to get a site, and saves the result in the $Site variable.

The second command creates a SharePoint Online library in the site specified in the $Site variable.

Parameters

-Description

Specifies a description of a sp_online_2 library. The cmdlet creates the library with the description that you specify.

Type:String
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-EnableVersioning

Indicates that versioning is enabled for this library.

Type:SwitchParameter
Position:4
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ForceCheckout

Indicates that force checkout is enabled for this library.

Type:SwitchParameter
Position:5
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-LibraryType

Specifies the type of a sp_online_2 library. The cmdlet creates the library with the type that you specify.

Type:SharePointLibraryType
Accepted values:NoListTemplate, DocumentLibrary, PictureLibrary, WebPageLibrary, InvalidType
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of a library. The cmdlet creates the sp_online_2 library with the name that you specify.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Site

Specifies a sp_online_2 site. The cmdlet creates the library in the site that you specify. If you do not specify this parameter, the cmdlet creates the library under the default site.

Type:SharePointSite
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Name

Type: System.String

Description: Name of the SharePoint library

Outputs

SharePointLibrary