I have this pnp script which adds a button to a list view ribbon.
It runs and I can delete the button in script and know that is was there and deleted by count.
But, the pnp script to add the button doesn't work until after I had run a console app to add a button to the list.
It is as though some structure needs to be setup that the pnp script isn't doing and the console app does.
Here is the pnp script:
`$cUIExtn = "<CommandUIDefinition Location=""Ribbon.ListItem.Actions.Controls._children"">
<Button Id=""Ribbon.List.Items.Action.MyButton"" Alt=""Promote Request""
Sequence=""03"" Command=""ShowPromoMoreButtons""
LabelText=""Promote Selected""
TemplateAlias=""o1""
Image32by32=""/sites/Practice/images/Perspective-Button-Reboot-icon-32.png""
Image16by16=""/sites/Practice/images/Perspective-Button-Reboot-icon-16.png"" />
Using 2016 PnP latest.
I have this pnp script which adds a button to a list view ribbon.
It runs and I can delete the button in script and know that is was there and deleted by count. But, the pnp script to add the button doesn't work until after I had run a console app to add a button to the list.
It is as though some structure needs to be setup that the pnp script isn't doing and the console app does.
Here is the pnp script: `$cUIExtn = "<CommandUIDefinition Location=""Ribbon.ListItem.Actions.Controls._children"">
<Button Id=""Ribbon.List.Items.Action.MyButton"" Alt=""Promote Request""
Sequence=""03"" Command=""ShowPromoMoreButtons""
LabelText=""Promote Selected""
TemplateAlias=""o1""
Image32by32=""/sites/Practice/images/Perspective-Button-Reboot-icon-32.png""
Image16by16=""/sites/Practice/images/Perspective-Button-Reboot-icon-16.png"" />
"
Add-PnPCustomAction -Name "MoreButtonsReq" -Title "Promote This" -Description "MoreButtonsReq" -Location "CommandUI.Ribbon" -Group "SiteActions" -RegistrationType List -registrationId "{gggggggg-gggg-421a-gggg-246b00ef7a82}" -Rights EditListItems -Scope Web -CommandUiExtension $cUIExtn `
Here is the console app c#: ` SPSite osite = new SPSite(SiteURL);
`