In this blog, we are going to retrieve all the fields from a list and will add/remove a field from a SharePoint list using PnP PowerShell. For that, first, we need to connect to the site.
To establish the connection, add this command.
$SiteUrl = Read-Host “Provide Site URL”
Connect-PnPOnline -Url $SiteUrl
#Executing this line will ask for credentials. Provide a username and password to connect.
To retrieve all fields, add the below command.
$Fields = Get-PnPField -List “Test”

To add a field to a list, add this command.
Add-PnPField -List “Test” -DisplayName “Designation” -InternalName “Designation” -Type MultiChoice -AddToDefaultView -Choices “HR”,”CEO”, “DEVELOPER”,”TESTER”
To remove a field from list, execute this command.
Remove-PnPField -List “Test” -Identity “Designation”
Executing this command opens a popup window for confirmation of the field to be deleted.

Clicking on YES will remove the field from the list.

SharePoint 2013 Hosting Recommendation

HostForLIFE.eu’s SharePoint 2013 Hosting solution offers a comprehensive feature set that is easy-to-use for new users, yet powerful enough for the most demanding web developer expert. Hosted SharePoint Foundation 2013 is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2013 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. HostForLIFE.eu offers a variety of hosted SharePoint Foundation 2013 plans as well as dedicated SharePoint 2013 Foundation options.

hostforlifebanner