{"id":1059,"date":"2019-04-25T09:43:39","date_gmt":"2019-04-25T09:43:39","guid":{"rendered":"http:\/\/blog.softreeconsulting.com\/?p=1059"},"modified":"2019-04-25T09:43:39","modified_gmt":"2019-04-25T09:43:39","slug":"add-custom-action-in-sharepoint-site-using-pnp-powershell","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/","title":{"rendered":"Add And Remove Operation Of Custom Action In SharePoint Site Using PnP PowerShell"},"content":{"rendered":"\n<p>In this blog, we will see how we can add a custom action in SharePoint site using PnP PowerShell. Also, we will see how we can get particular custom action and remove it from the SharePoint site using PnP PowerShell.<\/p>\n\n\n\n<p><strong>Add Custom Action:-<\/strong><\/p>\n\n\n\n<p>In the following example, I have added a personal action menu in my SharePoint site.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2019\/04\/Add-And-Remove-Operation-Of-Custom-Action-In-SharePoint-Site-Using-PnP-PowerShell.png\" alt=\"\" class=\"wp-image-1085\"\/><\/figure><\/div>\n\n\n\n<p><strong>Get Particular Custom action and\nremove it from site:-<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>You can get all user custom action present under site using the following script:<\/li><\/ul>\n\n\n\n<p>\u201cGet-PnPCustomAction\u201d<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In the following example, it shows how you can get particular custom action and remove it from the SharePoint site. In this particular example it removes all custom actions that are ScriptLinks:<\/li><\/ul>\n\n\n\n<p>\u201cGet-PnPCustomAction -Scope All |? Location -eq ScriptLink | Remove-PnPCustomAction\u201d<\/p>\n\n\n\n<p><strong>Connect-PnPOnline \u2013Url\nhttps:\/\/yoursite.sharepoint.com \u2013Credentials (Get-Credential)<\/strong><\/p>\n\n\n\n<p><strong>&lt;#Add user custom action in your\nSharePoint site.<\/strong><\/p>\n\n\n\n<p><strong>Here it adds my custom action under\npersonal action menu#&gt;<\/strong><\/p>\n\n\n\n<p><strong>Add-PnPCustomAction -Name &#8216;MyCustomActionMenu&#8217; -Title &#8216;My Custom Menu&#8217; -Description &#8216;Adds custom action to personal action menu&#8217; -Group &#8216;PersonalActions&#8217; -Location &#8216;Microsoft.SharePoint.StandardMenu&#8217; -Sequence 3010 -Url &#8216;javascript:alert(&#8220;My custom action menu&#8221;);&#8217;<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;#Get all custom action present under a site#>  \nGet-PnPCustomAction  \n&lt;#Removes all custom actions that are ScriptLinks#>  \nGet-PnPCustomAction -Scope All |? Location -eq ScriptLink | Remove-PnPCustomAction  <\/code><\/pre>\n\n\n\n<p><strong>This solution is brought to you by our SharePoint professionals.<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/www.softreetechnology.com\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Softree Technology (opens in a new tab)\">Softree Technology<\/a>\u00a0employs SharePoint consultants; we are a technology services provider with the aim to help companies achieve exceptional performance through SharePoint. Our dedicated team of SharePoint consultants has the right bent of mind to understand and execute customer requirements.<\/p>\n\n\n\n<p>Be it\u00a0SPFx or SharePoint\u00a0add-in developments,\u00a0SharePoint 2019 developments, <a href=\"https:\/\/www.softreetechnology.com\/sharepoint-projects\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"web part developments (opens in a new tab)\">web part developments<\/a>, migrating from SharePoint 2010\/2013 to SharePoint 2013\/2016\/Office 365, Office 365,\u00a0SharePoint hosted apps development\u00a0or something else in SharePoint, we strive to deliver the best<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we will see how we can add a custom action in SharePoint site using PnP PowerShell. Also, we will see how we can get particular custom action and remove it from the SharePoint site using PnP PowerShell. Add Custom Action:- In the following example, I have added a personal action menu in my SharePoint site. Get Particular [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[221,43],"tags":[246,247,248,249],"class_list":["post-1059","post","type-post","status-publish","format-standard","hentry","category-powershell","category-sharepoint","tag-custom-action-operations-in-sharepoint-using-pnp-powershell","tag-how-to-add-a-personal-action-menu-in-sharepoint-site-using-pnp-powershell","tag-how-to-add-custom-action-in-sharepoint-site","tag-how-to-add-custom-action-using-pnp-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Add And Remove Operation Of Custom Action In SharePoint Site 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\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add And Remove Operation Of Custom Action In SharePoint Site Using PnP PowerShell - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"In this blog, we will see how we can add a custom action in SharePoint site using PnP PowerShell. Also, we will see how we can get particular custom action and remove it from the SharePoint site using PnP PowerShell. Add Custom Action:- In the following example, I have added a personal action menu in my SharePoint site. Get Particular [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-25T09:43:39+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":"Add And Remove Operation Of Custom Action In SharePoint Site 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\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Add And Remove Operation Of Custom Action In SharePoint Site Using PnP PowerShell - Softree Technology","og_description":"In this blog, we will see how we can add a custom action in SharePoint site using PnP PowerShell. Also, we will see how we can get particular custom action and remove it from the SharePoint site using PnP PowerShell. Add Custom Action:- In the following example, I have added a personal action menu in my SharePoint site. Get Particular [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/","og_site_name":"Softree Technology","article_published_time":"2019-04-25T09:43:39+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\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"Add And Remove Operation Of Custom Action In SharePoint Site Using PnP PowerShell","datePublished":"2019-04-25T09:43:39+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/"},"wordCount":278,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2019\/04\/Add-And-Remove-Operation-Of-Custom-Action-In-SharePoint-Site-Using-PnP-PowerShell.png","keywords":["Custom action operations in SharePoint using PnP PowerShell","How to add a personal action menu in SharePoint site using PnP PowerShell","How to add custom action in SharePoint site","How to add custom action using PnP PowerShell"],"articleSection":["PowerShell","SharePoint"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/","url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/","name":"Add And Remove Operation Of Custom Action In SharePoint Site Using PnP PowerShell - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2019\/04\/Add-And-Remove-Operation-Of-Custom-Action-In-SharePoint-Site-Using-PnP-PowerShell.png","datePublished":"2019-04-25T09:43:39+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/#primaryimage","url":"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2019\/04\/Add-And-Remove-Operation-Of-Custom-Action-In-SharePoint-Site-Using-PnP-PowerShell.png","contentUrl":"https:\/\/blog.softreeconsulting.com\/wp-content\/uploads\/2019\/04\/Add-And-Remove-Operation-Of-Custom-Action-In-SharePoint-Site-Using-PnP-PowerShell.png"},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/add-custom-action-in-sharepoint-site-using-pnp-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Add And Remove Operation Of Custom Action In SharePoint Site 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\/1059","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=1059"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/1059\/revisions"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=1059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=1059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=1059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}