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 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 Custom action and remove it from site:-
- You can get all user custom action present under site using following script:
- In the following example it shows how you can get particular custom action and remove it from SharePoint site. In this particular example it removes all custom actions that are ScriptLinks:
“Get-PnPCustomAction -Scope All |? Location -eq ScriptLink | Remove-PnPCustomAction”
Connect-PnPOnline –Url https://yoursite.sharepoint.com –Credentials (Get-Credential)
<#Add user custom action in your SharePoint site.
Here it adds my custom action under personal action menu#>
&lt;#Get all custom action present under a site#&gt; Get-PnPCustomAction &lt;#Removes all custom actions that are ScriptLinks#&gt; Get-PnPCustomAction -Scope All |? Location -eq ScriptLink | Remove-PnPCustomAction
This solution is brought to you by our SharePoint professionals.
Softree Consulting employs 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.
Be it SPFx or SharePoint add-in developments, SharePoint 2019 developments, web part developments, migrating from SharePoint 2010/2013 to SharePoint 2013/2016/Office 365, Office 365, SharePoint hosted apps development or something else in SharePoint, we strive to deliver the best