New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chrisobriensp opened this Issue Sep 5, 2017 · 8 comments

Comments

Projects
None yet
6 participants
@chrisobriensp

chrisobriensp commented Sep 5, 2017

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

This comment has been minimized.

Show comment
Hide comment
@VesaJuvonen

VesaJuvonen Sep 8, 2017

Contributor

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

Contributor

VesaJuvonen commented Sep 8, 2017

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

@VesaJuvonen

This comment has been minimized.

Show comment
Hide comment
@VesaJuvonen

VesaJuvonen Sep 10, 2017

Contributor

Fixed with September 2017 release, so closing this.

Contributor

VesaJuvonen commented Sep 10, 2017

Fixed with September 2017 release, so closing this.

@patrickabel

This comment has been minimized.

Show comment
Hide comment
@patrickabel

patrickabel Sep 28, 2017

@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 commented Sep 28, 2017

@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

This comment has been minimized.

Show comment
Hide comment
@patrickabel

patrickabel Sep 28, 2017

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?

patrickabel commented Sep 28, 2017

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

This comment has been minimized.

Show comment
Hide comment
@Sickb0t

Sickb0t 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 ?

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

This comment has been minimized.

Show comment
Hide comment
@raymondlittle100

raymondlittle100 Jan 10, 2018

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

raymondlittle100 commented Jan 10, 2018

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

This comment has been minimized.

Show comment
Hide comment
@rmillener

rmillener May 2, 2018

@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.

rmillener commented May 2, 2018

@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

This comment has been minimized.

Show comment
Hide comment
@raymondlittle100

raymondlittle100 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

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 join this conversation on GitHub. Already have an account? Sign in to comment