Create A List In SharePoint Online Using PnP Powershell

Today, we’ll look at creating SharePoint List in office 365 using PowerShell PnP.
 
For more info about the Practices & Patterns (PnP), refer to the official documentation, and/or download the modules from the hard workers in GitHub – SharePoint PowerShell PnP.
 
First we need to connect the SharePoint Online site using the below command,
 
Step 1
 
Open SharePoint Management Shell as an Administrator in your machine.
 
Step 2
 
Run the following command to import PnP to install the PowerShell cmdlets:
  1. Install-Module SharePointPnPPowerShellOnline  
Step 3
 
To use the library you first need to connect to your tenant using the below cmdlets.
  1. connect-PnPOnline –Url https://fortunestrikes.sharepoint.com –Credentials (Get-Credential)  
Create a List/ document library
 
Now that we’re logged into the site collection, let’s create our List/document library.
 
Syntax
 
This syntax is referred from msdn
  1. New-PnPList    
  2. -Title <String>    
  3. -Template <ListTemplateType>    
  4. [-Url <String>]    
  5. [-Hidden [<SwitchParameter>]]    
  6. [-EnableVersioning [<SwitchParameter>]]    
  7. [-EnableContentTypes [<SwitchParameter>]]    
  8. [-OnQuickLaunch [<SwitchParameter>]]    
  9. [-Web <WebPipeBind>]    
  10. [-Connection <PnPConnection>]     
Create List
  1. New-PnPList -Title Demo Lisy -Template GenericList    
  2. Write-Host "TEST list successfully created" -ForegroundColor Green  
Create Libraray
 
Run the following command to create a document library,
  1. New-PnPList -Title "Demo Library" -Template DocumentLibrary -OnQuickLaunch  
Thanks for reading my blog.