{"id":5877,"date":"2019-10-03T11:39:10","date_gmt":"2019-10-03T11:39:10","guid":{"rendered":"https:\/\/www.softreetechnology.com\/?p=5877"},"modified":"2019-10-03T11:39:10","modified_gmt":"2019-10-03T11:39:10","slug":"retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/","title":{"rendered":"Retrieve, Add, Remove Fields from a SharePoint list using PNP PowerShell"},"content":{"rendered":"\n<p>In this blog, we are going to retrieve all fields from a list, add, remove a field from a SharePoint list using PnP PowerShell. First, we need to connect to the Site. <\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>First We Need to Connect to the Site. To Perform Connection Add<\/strong><\/li><\/ol>\n\n\n\n<p>$SiteUrl = Read-Host &#8220;Provide Site url&#8221; <\/p>\n\n\n\n<p>Connect-PnPOnline -Url $SiteUrl<\/p>\n\n\n\n<p>#Executing this line will ask for credentials. Provide user name and password to connect. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2019\/10\/1-3.jpg\" alt=\"\" class=\"wp-image-5878\"\/><\/figure>\n\n\n\n<p><strong>2. To retrieve all fields add below command<\/strong><\/p>\n\n\n\n<p>$Fields = Get-PnPField\u00a0 -List &#8220;Test&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2019\/10\/2-2-1024x899.jpg\" alt=\"\" class=\"wp-image-5879\"\/><\/figure>\n\n\n\n<p><strong>3. To add a field to a list<\/strong><\/p>\n\n\n\n<p>Add-PnPField -List &#8220;Test&#8221; -DisplayName &#8220;Designation&#8221; -InternalName &#8220;Designation&#8221; -Type MultiChoice\u00a0 -AddToDefaultView -Choices &#8220;HR&#8221;,&#8221;CEO&#8221;, &#8220;DEVELOPER&#8221;,&#8221;TESTER&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2019\/10\/3-2-1024x439.jpg\" alt=\"\" class=\"wp-image-5880\"\/><\/figure>\n\n\n\n<p><strong>4. To remove a field from the list<\/strong><\/p>\n\n\n\n<p>Remove-PnPField -List &#8220;Test&#8221; -Identity\n&#8220;Designation&#8221;<\/p>\n\n\n\n<p>Executing this command open a pop-up window for confirmation of field delete<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2019\/10\/4-2.jpg\" alt=\"\" class=\"wp-image-5881\"\/><\/figure>\n\n\n\n<p><strong>Clicking on yes will remove the field from list.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2019\/10\/5-2-1024x761.jpg\" alt=\"\" class=\"wp-image-5882\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we are going to retrieve all fields from a list, add, remove a field from a SharePoint list using PnP PowerShell. First, we need to connect to the Site. First We Need to Connect to the Site. To Perform Connection Add $SiteUrl = Read-Host &#8220;Provide Site url&#8221; Connect-PnPOnline -Url $SiteUrl #Executing this line will ask for credentials. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5883,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[298],"tags":[313,314,315,316,317,318],"class_list":["post-5877","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pnp-powershell","tag-add-a-field-to-a-list-using-pnp-powershell","tag-add-and-remove-field-using-pnp-powershell","tag-delete-a-field-from-a-list-using-pnp-powershell","tag-get-fields-of-a-list-using-pnp-powershell","tag-remove-a-field-from-a-list-using-pnp-powershell","tag-retrieve-fields-of-a-list-library-using-pnp-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Retrieve, Add, Remove Fields from a SharePoint list using PNP PowerShell - Softree Technology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Retrieve, Add, Remove Fields from a SharePoint list using PNP PowerShell - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"In this blog, we are going to retrieve all fields from a list, add, remove a field from a SharePoint list using PnP PowerShell. First, we need to connect to the Site. First We Need to Connect to the Site. To Perform Connection Add $SiteUrl = Read-Host &#8220;Provide Site url&#8221; Connect-PnPOnline -Url $SiteUrl #Executing this line will ask for credentials. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-03T11:39:10+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Retrieve, Add, Remove Fields from a SharePoint list using PNP PowerShell - Softree Technology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Retrieve, Add, Remove Fields from a SharePoint list using PNP PowerShell - Softree Technology","og_description":"In this blog, we are going to retrieve all fields from a list, add, remove a field from a SharePoint list using PnP PowerShell. First, we need to connect to the Site. First We Need to Connect to the Site. To Perform Connection Add $SiteUrl = Read-Host &#8220;Provide Site url&#8221; Connect-PnPOnline -Url $SiteUrl #Executing this line will ask for credentials. [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/","og_site_name":"Softree Technology","article_published_time":"2019-10-03T11:39:10+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"Retrieve, Add, Remove Fields from a SharePoint list using PNP PowerShell","datePublished":"2019-10-03T11:39:10+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/"},"wordCount":143,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/#primaryimage"},"thumbnailUrl":"","keywords":["Add a field to a list using pnp powershell","Add and remove field using pnp powershell","Delete a field from a list using pnp powershell","Get fields of a list using pnp powershell","Remove a field from a list using pnp powershell","Retrieve fields of a list\/library using pnp powershell"],"articleSection":["PnP PowerShell"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/","url":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/","name":"Retrieve, Add, Remove Fields from a SharePoint list using PNP PowerShell - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/#primaryimage"},"thumbnailUrl":"","datePublished":"2019-10-03T11:39:10+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/pnp-powershell\/retrieve-add-remove-fields-from-a-sharepoint-list-using-pnp-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Retrieve, Add, Remove Fields from a SharePoint list using PNP PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/softreetechnology.com\/blog\/#website","url":"https:\/\/softreetechnology.com\/blog\/","name":"Softree Technology","description":"Celebrating 10+ Years in SharePoint Consulting !","publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/softreetechnology.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/softreetechnology.com\/blog\/#organization","name":"Softree Technology","url":"https:\/\/softreetechnology.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","contentUrl":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","width":844,"height":230,"caption":"Softree Technology"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/softreeconsulting.com"],"url":"https:\/\/softreetechnology.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/5877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=5877"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/5877\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=5877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=5877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=5877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}