Forum Discussion
StephanieDuryHydro
Oct 09, 2023Copper Contributor
How can I create multiple site columns in SharePoint using PowerShell?
Hi all, I'm trying to create 64 site columns (not list columns) in the Content Type Hub site so I can reuse these columns throughout our tenancy. I have found posts about how to create multiple l...
SvenSieverding
Oct 09, 2023Bronze Contributor
Hi StephanieDuryHydro ,
you could use PnP Powershell and the "Add-PnFPield" command
Add-PnPField -Type Choice -Choices "PnP","Parker","Sharing Is Caring" -DisplayName "My Test Column" -InternalName "MyTestCol" -Group "MyGroup" -Required
https://pnp.github.io/powershell/cmdlets/Add-PnPField.html
If you specify the "-List" Parameter then this command creates a list column on that list and a site column otherwise.
Best Regards