cli-microsoft365 icon indicating copy to clipboard operation
cli-microsoft365 copied to clipboard

New command: m365 pp website webfile list

Open appieschot opened this issue 1 year ago • 5 comments

Usage

m365 pp website webfile list

Description

List all webfiles for the specified Power Pages website

Options

Option Description
--websiteId [websiteId] ID of the Power Pages website. Specify either websiteId or webName but not both.
--websiteName [websiteName] The unique name (not the display name) of the Power Pages website. Specify either websiteId or webName but not both.
-e, --environmentName <environmentName> The name of the environment where the Power Pages websites are located.
--asAdmin Run the command as admin and retrieve Power Pages websites for environments you do not have explicitly assigned permissions to.

Examples

List all webfiles for the site Contoso

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

List all webfiles for the site by id

m365 pp website webfile list --websiteId 2ca3eaa5-140f-4175-8261-3272edf9f339--environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339"

Default properties

  • Name
  • Id
  • Description
  • Publishing State

Additional Info

More details here: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/reference/entities/mspp_webfile

See our m365 pp card list command on how to implement the as admin, and how to retrieve all items from a given endpoint: https://github.com/pnp/cli-microsoft365/blob/main/src/m365/pp/commands/card/card-list.ts

In this case the API call would be ${dynamicsApiUrl}/api/data/v9.2/mspp_webfiles

appieschot avatar Aug 22 '24 06:08 appieschot

Added an additional default property; the ID of the item helps with later commands (i.e. get commands)

appieschot avatar Aug 23 '24 07:08 appieschot

May I take this up?

ktskumar avatar Oct 03 '24 00:10 ktskumar

Sure, all yours!

milanholemans avatar Oct 03 '24 07:10 milanholemans

Api returns the default properties in below names,

  • Name: 'mspp_name',
  • Id: 'mspp_webfileid',
  • Description: 'mspp_summary',
  • Publishing State: '_mspp_publishingstateid_value@OData.Community.Display.V1.FormattedValue'

Below is the returned response for single object,

{
    "mspp_name": "filename.css",
    "_mspp_websiteid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "mspp_websiteid",
    "[email protected]": "mspp_website",
    "[email protected]": "Website - spddevdocs",
    "_mspp_websiteid_value": "6c0730c5-3c40-4e49-81da-6fbcd018942d",
    "_mspp_parentpageid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "mspp_parentpageid",
    "_mspp_parentpageid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "mspp_webpage",
    "_mspp_parentpageid_value@OData.Community.Display.V1.FormattedValue": "Home",
    "_mspp_parentpageid_value": "cfca0f6b-ea6f-4f5d-a2b6-de411d67c970",
    "mspp_partialurl": "filename.css",
    "mspp_displaydate": null,
    "_mspp_publishingstateid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "mspp_publishingstateid",
    "_mspp_publishingstateid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "mspp_publishingstate",
    "_mspp_publishingstateid_value@OData.Community.Display.V1.FormattedValue": "Published",
    "_mspp_publishingstateid_value": "705b586a-ec8b-49a2-805d-ce2ebb91b0ff",
    "mspp_releasedate": null,
    "mspp_expirationdate": null,
    "mspp_cloudblobaddress": null,
    "mspp_contentdisposition@OData.Community.Display.V1.FormattedValue": "inline",
    "mspp_contentdisposition": 756150000,
    "mspp_title": null,
    "mspp_summary": null,
    "mspp_alloworigin": null,
    "[email protected]": "No",
    "mspp_hiddenfromsitemap": false,
    "[email protected]": "2",
    "mspp_displayorder": 2,
    "_mspp_masterwebfileid_value": null,
    "[email protected]": "Yes",
    "mspp_excludefromsearch": true,
    "statecode": 0,
    "mspp_webfileid": "9f39994e-2170-4064-9ae5-fe1676855d79",
    "[email protected]": "systemuser",
    "[email protected]": "Shantha Kumar Thambidurai",
    "_mspp_createdby_value": "5364ffa6-d185-eeff-8179-6045bd002666",
    "[email protected]": "systemuser",
    "[email protected]": "Shantha Kumar Thambidurai",
    "_mspp_modifiedby_value": "5364ffa6-d185-eeff-8179-6045bd002666",
    "[email protected]": "5/16/2024 11:36 AM",
    "mspp_modifiedon": "2024-05-16T06:06:38Z",
    "[email protected]": "5/16/2024 11:36 AM",
    "mspp_createdon": "2024-05-16T06:06:34Z",
    "[email protected]": "Active",
    "statuscode": 1
  }

Do I need to rename / modify the property names after retrieving the result. Please suggest

ktskumar avatar Oct 06 '24 08:10 ktskumar

Hi @ktskumar, generally speaking, we never modify the output of the API, so no, just return the result.

milanholemans avatar Oct 06 '24 21:10 milanholemans