Skip to content

[BUG] Remove-PnPCustomAction is giving Method not found error #4809

@yvsuhas

Description

@yvsuhas

Reporting an Issue

Using the command Remove-PnPCustomAction -Identity "Microsoft Clarity" -Force or Remove-PnPCustomAction -Identity -Force (with or without force) is not removing the custom action instead giving an error

Expected behavior

Remove the custom action based on the title or id

Actual behavior

The command is giving the following error
_Remove-PnPCustomAction : Method not found: 'System.Threading.Tasks.ValueTask1<Boolean> System.Collections.Generic.IAsyncEnumerator1.MoveNextAsync()'.
At line:1 char:1

  • Remove-PnPCustomAction -Identity 34669724-42ad-46ed-aacf-8d1eeb33fc72 ...
  •   + CategoryInfo          : InvalidOperation: (:) [Remove-PnPCustomAction], PSInvalidOperationException
      + FullyQualifiedErrorId : InvalidOperation,PnP.PowerShell.Commands.Branding.RemoveCustomAction_
    
    

Steps to reproduce behavior

Add a custom action using the Add-PnPCustomAction such as below
Add-PnPCustomAction -ClientSideComponentId '7f8fd1f2-9d26-4a4a-a607-bf4622d7ec11' -Name "Microsoft Clarity" -Title "Microsoft Clarity" -Location ClientSideExtension.ApplicationCustomizer -ClientSideComponentProperties: '{"clarityID":"qt30w4b2o3"}' -Scope site

Get-PnPCustomAction -scope all will show the list of all custom actions and select any custom action that can be removed

Run the following command to remove a specific custom action
Remove-PnPCustomAction -Identity "Microsoft Clarity" -Force or Remove-PnPCustomAction -Identity -Force (with or without force

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

2.12.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions