pnp / cli-microsoft365

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

New command: m365 pp website webfile remove #6320

Open appieschot opened 1 week ago

appieschot commented 1 week ago

Usage

m365 pp website webfile remove [options]

Description

Removes the specified webfile

Options

Option Description
-i, --id [id] ID of the webfile 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 webfile 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 2ca3eaa5-140f-4175-8261-3272edf9f339 Power Pages website Contoso-Demo in the given environment.

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

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

m365 pp website webfile 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/mspp_webfile. In this case the API call would be a 1DELETErequest to${dynamicsApiUrl}/api/data/v9.2/mspp_webfiles(webfileid)`

Adam-it commented 1 week ago

@appieschot here I have the same comments as in the webrole and weblink removal issues:

appieschot commented 6 days ago

Updated, I have removed the name and updated the typo