Skip to content

Restore-MgDirectoryDeletedItem: A parameter cannot be found that matches parameter name 'BodyParameter'. #3353

@manuel-falcao-magalhaes

Description

@manuel-falcao-magalhaes

Describe the bug

I was trying to use Restore-MgDirectoryDeletedItem while passing the autoReconcileProxyConflict property.

This is showcased in Example 2 of the cmdlet's documentation (https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.directorymanagement/restore-mgdirectorydeleteditem?view=graph-powershell-1.0#example-2-restore-a-deleted-item-and-remove-any-conflicting-proxy-addresses) and in Example 2 of the respective API's documentation (https://learn.microsoft.com/en-us/graph/api/directory-deleteditems-restore?view=graph-rest-1.0&tabs=powershell#example-2-restore-a-deleted-item-and-remove-any-conflicting-proxy-addresses (see PowerShell tab))

However, that parameter does not exist. A "A parameter cannot be found that matches parameter name 'BodyParameter'." error is thrown.

Expected behavior

I was expecting the BodyParameter parameter to exist, as documented. Without it, there's no other way to pass the autoReconcileProxyConflict property using the Restore-MgDirectoryDeletedItem cmdlet.

How to reproduce

  1. Execute Restore-MgDirectoryDeletedItem -DirectoryObjectId "[object id here]" -BodyParameter $params
  2. The error should appear.

SDK Version

2.28.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions