PNP PowerShell script to speed up SharePoint list building

Software Developer Matthew Woodhall shared his tips to speed up list creation for SharePoint Development

“If like me, you are always looking for ways to speed up your development, here is a PowerShell script that will help with just that.”

Firstly, to use pnp for PowerShell you will need to install the modules. I will not be explaining that here, but you can check out this Microsoft documentation to help with that.

Simply open up PowerShell on your pc and type in the code below.

This code will add a single line of text column to a SharePoint list with the display column name of test

To add more columns at once just simply copy and paste the last line again into the code and change the internal and display name to your choosing (you could even loop through a input file to speed this up).

A couple things to note here. The internal name will be the name used to get the field value and trigger conditions in other applications such as power automate and PowerApps, this cannot be altered once the field is created.

The display name is the front facing name which will be displayed and can be altered after it is set.

To change the type of column simple change -Type Text to -Type whichever column type you would like, here are a list of accepted types:

Invalid, Integer, Text, Note, DateTime, Counter, Choice, Lookup, Boolean, Number, Currency, URL, Computed, Threading, Guid, MultiChoice, GridChoice, Calculated, File, Attachments, User, Recurrence, CrossProjectLink, ModStat, Error, ContentTypeId, PageSeparator, ThreadIndex, WorkflowStatus, AllDayEvent, WorkflowEventType, Geolocation, OutcomeChoice, Location, Thumbnail, MaxItems.

If you need any assistance or advice on these tools or general SharePoint advice, don’t hesitate to get in touch


Leave a Reply

Your email address will not be published. Required fields are marked *