With
the free kalmstrom.com service
SharePoint PnP List Generator, you can create new
SharePoint lists with new content types in a way that follows
recommended practices.
The generator builds a PowerShell script for the list from
the values for content type and site columns that the user
enters in the form. List data can also be added.
When everything is entered, copy the PowerShell code, paste
it in Windows PowerShell ISE and run it, and the new list
is quickly created.
Enter the name of a content type group. It can be
a new or an existing group.
Enter the URL to the SharePoint site where you want
the new list to be created.
Select SharePoint version.
Select PowerShell version.
Select Parent content type.
Enter the name of the new content type you want
to create.
Enter the name of the new list.
Enter the names of the site columns and specify
the column types.
(Enter data to be added to the list.)
Copy the PowerShell code.
Run Visual Studio Code (PowerShell V7) or Windows
PowerShell ISE (PowerShell V5) as an administrator.
Open a new script and paste the PowerShell code
you copied from the PnP Generator.
Make any changes you prefer in the script.
Run the script. Now the list will be created in
the SharePoint site you specified in the PnP List Generator.
Peter Kalmström, CEO and Systems Designer of kalmstrom.com
Business Solutions, shows the process in the demo below.
Peter also explains what the PowerShell script does and
where you can see the different steps in the code.
Note that the demo was created with an earlier version of
the generator, which only supported PowerShell version 5
and SharePoint Online, and therefore no selection was necessary.
Otherwise, the process to fill out the generator is similar.
However, PowerShell version 7 is run and edited in Visual
Studio Code, while version 5 uses Windows PowerShell ISE.
The steps above describes the current version of the PnP
List Generator, and you can see it in the first demo in
the import article.
Remove-All
If you need to start over we recommend running the Remove-All
function at the end of the PnP List Generator PowerShell
code. That function removes everything and lets you start
over from scratch.
Note that the Remove-All function removes everything, as
the name implies. The content type, the site columns, the
list and the list items are all gone after you have run
this code. The code also empties the recycle bin, so there
will be no restoring items if you change your mind. This
is a power-user tool, use it with caution.
Import data
As data can be added to the SharePoint PnP List Generator,
it is also useful if you want to import data into SharePoint
from Excel or another table and when you want to create
a better SharePoint list to replace an existing one. In
another demo, Peter shows how to
import an Excel spreadsheet to a SharePoint list with the
PnP Generator.
Learn more
Software that enhances SharePoint
Kanban Task Manager Visualize and co-operate on projects and tasks in SharePoint
and/or Outlook
Pivot Explorer Visualize and analyze list data in SharePoint
Templates Manager
Find, use, manage and distribute Office templates in SharePoint