pnp / cli-microsoft365

Manage Microsoft 365 and SharePoint Framework projects on any platform
https://aka.ms/cli-m365
MIT License
929 stars 326 forks source link

New command: m365 pp website webresource remove #6368

Open appieschot opened 2 months ago

appieschot commented 2 months ago

Usage

m365 pp website webresource remove [options]

Description

Removes the specified webresource

Options

Option Description
-i, --id [id] ID of the webresource to remove.
--websiteId [websiteId] ID of the Power Pages website. Specify either websiteId or websiteName but not both.
--websiteName [websiteName] The unique name (not the display name) of the Power Pages website. Specify either websiteId or websiteName but not both.
-e, --environmentName <environmentName> The name of the environment where the web role is located.
--asAdmin Run the command as admin and retrieve Power Pages websites for environments you do not have explicitly assigned permissions to.
-f, --force Don't prompt for confirmation

Examples

Deletes webresource 2ca3eaa5-140f-4175-8261-3272edf9f339 from Power Pages website Contoso-Demo in the given environment.

m365 pp website webresource remove --id "2ca3eaa5-140f-4175-8261-3272edf9f339" --websiteName Contoso-Demo --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339"

Deletes a webresource from the selected Power Pages website in the given environment without confirmation prompt.

m365 pp website webresource remove --id "2ca3eaa5-140f-4175-8261-3272edf9f339" --websiteId 2ca3eaa5-140f-4175-8261-3272edf9f339 --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --force

Additional Info

More details here: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/reference/entities/webresourceset. In this case the API call would be a DELETE request to ${dynamicsApiUrl}/api/data/v9.2/webresourceset(webresourceid)

Adam-it commented 4 days ago

LGTM 👍 Let's open it up! @appieschot may I kindly ask you to update the link to the endpoint docs. It seems to be redirecting to 404.