New command: `m365 pp card clone`
See original GitHub issueUsage
m365 pp card clone
Description
Clones the specified Power Platform card.
Options
Option | Description |
---|---|
-i, --id [id] |
The ID of the card. Specify either id or name but not both. |
-n, --name [name] |
The name of the card. Specify either id or name but not both. |
--newName <newName> |
The name of the new card |
-e, --environment <environment> |
The name of the environment from which to clone the card. |
--asAdmin |
Run the command as admin and clone the card in environments you do not have explicitly assigned permissions to. |
Examples
Clones the card with the id d87a7535-dd31-4437-bfe1-95340acd55c5 named Default-d87a7535-dd31-4437-bfe1-95340acd55c5. to ContosoCard
m365 pp card clone --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id d87a7535-dd31-4437-bfe1-95340acd55c5 --newName "ContosoCard"
Clones the card with the id d87a7535-dd31-4437-bfe1-95340acd55c5 named Default-d87a7535-dd31-4437-bfe1-95340acd55c5. to ContosoCard as administrator.
m365 pp card clone --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id d87a7535-dd31-4437-bfe1-95340acd55c5 --newName "ContosoCard" --asAdmin
Additional Info
POST to https://org0116c1d1.crm4.dynamics.com/api/data/v9.1/CardCreateClone
Payload {CardId: "cardid-of-card-toclone<id>", CardName: "newName"}
response: "@odata.context":"https://org0116c1d1.crm4.dynamics.com/api/data/v9.1/$metadata#Microsoft.Dynamics.CRM.CardCreateCloneResponse","CardIdClone":"b41a8e57-28f2-4fd9-a13d-990daa84a757"}
@pnp/cli-for-microsoft-365-maintainers quick Q; we could use the name
as name for the new card as we do in teams team clone
but if we ever want to retrieve cards by their name we run into a problem. What is your feeling for the proper parameter for the name of a new card?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (9 by maintainers)
Sure can! I can make a function before cloning the card, that will just return the
props.id
if the id parameter is provided, and will make a call with the api/api/data/v9.1/cards?$filter=name eq 'Name'
so that this function will return theid
when thename
parameter is provided!Good point to keep it all consistent! 💪
Done.