Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: m365 pp website webfile list #6262

Open
appieschot opened this issue Aug 22, 2024 · 5 comments · May be fixed by #6415
Open

New command: m365 pp website webfile list #6262

appieschot opened this issue Aug 22, 2024 · 5 comments · May be fixed by #6415
Assignees

Comments

@appieschot
Copy link
Member

appieschot commented Aug 22, 2024

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 appieschot added the needs peer review Needs second pair of eyes to review the spec or PR label Aug 22, 2024
@Jwaegebaert Jwaegebaert added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Aug 23, 2024
@appieschot
Copy link
Member Author

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

@appieschot appieschot changed the title New command: m365 pp webfile list New command: m365 pp website webfile list Aug 26, 2024
@Adam-it Adam-it added the hacktoberfest Issue perfect for hacktoberfest label Sep 24, 2024
@ktskumar
Copy link
Contributor

ktskumar commented Oct 3, 2024

May I take this up?

@milanholemans
Copy link
Contributor

Sure, all yours!

@ktskumar
Copy link
Contributor

ktskumar commented Oct 6, 2024

Api returns the default properties in below names,

Below is the returned response for single object,

{
    "mspp_name": "filename.css",
    "_mspp_websiteid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "mspp_websiteid",
    "_mspp_websiteid_value@Microsoft.Dynamics.CRM.lookuplogicalname": "mspp_website",
    "_mspp_websiteid_value@OData.Community.Display.V1.FormattedValue": "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,
    "mspp_hiddenfromsitemap@OData.Community.Display.V1.FormattedValue": "No",
    "mspp_hiddenfromsitemap": false,
    "mspp_displayorder@OData.Community.Display.V1.FormattedValue": "2",
    "mspp_displayorder": 2,
    "_mspp_masterwebfileid_value": null,
    "mspp_excludefromsearch@OData.Community.Display.V1.FormattedValue": "Yes",
    "mspp_excludefromsearch": true,
    "statecode": 0,
    "mspp_webfileid": "9f39994e-2170-4064-9ae5-fe1676855d79",
    "_mspp_createdby_value@Microsoft.Dynamics.CRM.lookuplogicalname": "systemuser",
    "_mspp_createdby_value@OData.Community.Display.V1.FormattedValue": "Shantha Kumar Thambidurai",
    "_mspp_createdby_value": "5364ffa6-d185-eeff-8179-6045bd002666",
    "_mspp_modifiedby_value@Microsoft.Dynamics.CRM.lookuplogicalname": "systemuser",
    "_mspp_modifiedby_value@OData.Community.Display.V1.FormattedValue": "Shantha Kumar Thambidurai",
    "_mspp_modifiedby_value": "5364ffa6-d185-eeff-8179-6045bd002666",
    "mspp_modifiedon@OData.Community.Display.V1.FormattedValue": "5/16/2024 11:36 AM",
    "mspp_modifiedon": "2024-05-16T06:06:38Z",
    "mspp_createdon@OData.Community.Display.V1.FormattedValue": "5/16/2024 11:36 AM",
    "mspp_createdon": "2024-05-16T06:06:34Z",
    "statuscode@OData.Community.Display.V1.FormattedValue": "Active",
    "statuscode": 1
  }

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

@milanholemans
Copy link
Contributor

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

@ktskumar ktskumar linked a pull request Oct 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants