Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Add-PnPCustomAction gives error when used for SPFx extensions #1048

Closed
2 of 6 tasks
chrisobriensp opened this issue Sep 5, 2017 · 8 comments
Closed
2 of 6 tasks

Add-PnPCustomAction gives error when used for SPFx extensions #1048

chrisobriensp opened this issue Sep 5, 2017 · 8 comments

Comments

@chrisobriensp
Copy link

Reporting an Issue or missing feature

Issue

Expected behavior

When using Add-PnPCustomAction and specifying a ClientSideComponentId (e.g. when working with SPFx extensions), I expect to be able to successfully register the new Custom Action.

Actual behavior

I seem to see this behaviour, which doesn't seem right:

  • When a Group value is specified - receive error message saying that it's invalid to specify a Group when using ClientSideComponentId ("The specified properties Group are not supported for client-side custom action")
  • When a Group value not specified - parameter validation fails (a Group must be provided)

Steps to reproduce behavior

Add-PnPCustomAction -Name $spfxExtName -Group $spfxExtGroup -Title $spfxExtTitle -Description $spfxExtDescription -Location $spfxExtLocation -ClientSideComponentId $spfxExtension_GlobalHeaderID

(where $spfxExtGroup is either "" or "MyGroup")

Which version of the PnP-PowerShell Cmdlets are you using?

  • PnP PowerShell for SharePoint 2013
  • PnP PowerShell for SharePoint 2016
  • PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

2.17.1708.1

How did you install the PnP-PowerShell Cmdlets?

  • MSI Installed downloaded from GitHub
  • Installed through the PowerShell Gallery with Install-Module
  • Other means

Thanks for any help! :)

Cheers,

COB.

@VesaJuvonen
Copy link
Contributor

Hi Chris, we are looking to get this fixed with September release - coming out this weekend / Monday.

@VesaJuvonen
Copy link
Contributor

Fixed with September 2017 release, so closing this.

@patrickabel
Copy link

@chrisobriensp have you been able to successfully use the Add-PnPCustomAction cmdlet for a spfx extension following @VesaJuvonen's update?

I'm seeing what is likely user error – "Add-PnPCustomAction : Parameter set cannot be resolved using the specified named parameters."

Here's my PS command (leveraging your sample):
Add-PnPCustomAction -Name $spfxExtName -Group $spfxExtGroup -Title $spfxExtTitle -Description $spfxExtDescription -Location $spfxExtLocation -ClientSideComponentId $spfxExtClientSideComponentID

Here are my values for each of the variables:

  • Location = ClientSideExtension.ApplicationCustomizer
  • Name = alias from the extension's manifest.json (i.e. SomeAppInsightsApplicationCustomizer)
  • Title = alias from the extension's manifest.json (i.e. SomeAppInsightsApplicationCustomizer)
  • Group = someGroup
  • ClientSideComponentId = "id" from my extension's manifest.json file.

See anything I could be missing here?

@patrickabel
Copy link

It looks like I'm missing a required property : ClientSideComponentProperties.

Surprised to see this as required – I'm not making use of any client-side component properties with my extension. @VesaJuvonen could you point me to some additional information on this?

@Sickb0t
Copy link

Sickb0t commented Oct 2, 2017

Works if you don't use -Group and -Description, however can't set -Scope Site. Is this a bug? How do I deploy my extension on site collection level ?

@raymondlittle100
Copy link

I'm still having issues with this 'SharePointPnPPowerShellOnline' on version '2.22.1801.0'

I have tried with different group properties values and none work. I'm also getting an error 'Parameter set cannot be resolved using the specified named parameters.' when the -ClientSideComponentId -ClientSideComponentProperties are set

@rmillener
Copy link

@raymondlittle100 as SickB0t mentioned you will need to leave off -Description and -Group but you must have -ClientSideComponentId to do so.

As an example:

Add-PnPCustomAction -Name "MyApplicationCustomizer" -Title "My Application Customizer" -Location "ClientSideExtension.ApplicationCustomizer" -ClientSideComponentId $componentGuid

@VesaJuvonen should the documentation be updated to reflect this? Currently -Group and -Description are marked as required when in the case of Application Customizers you must explicitly not provide them.

@raymondlittle100
Copy link

raymondlittle100 commented Jun 27, 2018

Has anyone tried using the "Sequence" option when adding a custom action relating to application customizers. It seems to throw an error. I've logged the bug below but nothing back yet

#1624

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants