If you have not used PnP PowerShell you should use it, it is much easier to do tasks in PnP PowerShell.

Example: If you want to add a Choice column in SharePoint list or library.

Just few lines of code will do this and you don’t need to be on SharePoint server to do this.

But you need to install SharePoint PnP PowerShell


$encpassword = convertto-securestring -String "<<password>>" -AsPlainText -Force
 $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "<<domain\username", $encpassword
 Connect-PnPOnline <<site url>> -Credentials $cred
 Add-PnPField -List "<<list name>>" -DisplayName "<<Display name of column" -InternalName "<<internal name of column, make sure no space in name" -Type Choice -Group "<<groupname>>" -AddToDefaultView -Choices <<choice values such as - " 8"," 9"," 10">>

Reference: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/add-pnpfield?view=sharepoint-ps

Subscribe to my YouTube Channel https://www.youtube.com/channel/UC6vLzWN-3aFG8dgTgEOlx5g

Connect with me on Twitter or Linked In and follow YouTube Channel or my blog https://twitter.com/SinhaKislay




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s