diff --git a/docs/docs/cmd/aad/user/user-set.mdx b/docs/docs/cmd/aad/user/user-set.mdx index a8ba0e0442a..9c0d9a3b23e 100644 --- a/docs/docs/cmd/aad/user/user-set.mdx +++ b/docs/docs/cmd/aad/user/user-set.mdx @@ -13,11 +13,11 @@ m365 aad user set [options] ## Options ```md definition-list -`-i, --objectId [objectId]` -: The object ID of the user to update. Specify `objectId` or `userPrincipalName` but not both. +`-i, --id [id]` +: The object ID of the user to update. Specify `id` or `userName` but not both. -`-n, --userPrincipalName [userPrincipalName]` -: User principal name of the user to update. Specify `objectId` or `userPrincipalName` but not both. +`-n, --userName [userName]` +: User principal name of the user to update. Specify `id` or `userName` but not both. `--accountEnabled [accountEnabled]` : Boolean value specifying whether the account is enabled. Valid values are `true` or `false`. @@ -87,36 +87,36 @@ If the user with the specified ID or username doesn't exist, or if the specified Update specific property _department_ of user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_ ```sh -m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --department IT +m365 aad user set --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --department IT ``` Update multiple properties of user by name ```sh -m365 aad user set --userPrincipalName steve@contoso.onmicrosoft.com --firstName John --lastName Doe --jobTitle "Sales Manager" --companyName Contoso --department Sales --officeLocation "New York" +m365 aad user set --userName steve@contoso.onmicrosoft.com --firstName John --lastName Doe --jobTitle "Sales Manager" --companyName Contoso --department Sales --officeLocation "New York" ``` Enable user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_ ```sh -m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --accountEnabled true +m365 aad user set --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --accountEnabled true ``` Disable user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_ ```sh -m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --accountEnabled false +m365 aad user set --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --accountEnabled false ``` -Reset password of a given user by userPrincipalName and require the user to change the password on the next sign in +Reset password of a given user by userName and require the user to change the password on the next sign in ```sh -m365 aad user set --userPrincipalName steve@contoso.onmicrosoft.com --resetPassword --newPassword 6NLUId79Lc24 --forceChangePasswordNextSignIn +m365 aad user set --userName steve@contoso.onmicrosoft.com --resetPassword --newPassword 6NLUId79Lc24 --forceChangePasswordNextSignIn ``` Change password of the currently logged in user ```sh -m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --currentPassword SLBF5gnRtyYc --newPassword 6NLUId79Lc24 +m365 aad user set --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --currentPassword SLBF5gnRtyYc --newPassword 6NLUId79Lc24 ``` Updates a user with a manager diff --git a/docs/docs/cmd/pa/app/app-consent-set.mdx b/docs/docs/cmd/pa/app/app-consent-set.mdx index bbeaba8b005..154e81b1a9f 100644 --- a/docs/docs/cmd/pa/app/app-consent-set.mdx +++ b/docs/docs/cmd/pa/app/app-consent-set.mdx @@ -13,7 +13,7 @@ m365 pa app consent set [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-n, --name ` @@ -37,13 +37,13 @@ This command only works for canvas apps. Enables the bypass for the specified canvas app ```sh -m365 pa app consent set --environment 4be50206-9576-4237-8b17-38d8aadfaa36 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --bypass true +m365 pa app consent set --environmentName 4be50206-9576-4237-8b17-38d8aadfaa36 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --bypass true ``` Disables the bypass consent for the specified canvas app ```sh -m365 pa app consent set --environment 4be50206-9576-4237-8b17-38d8aadfaa36 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --bypass false --force +m365 pa app consent set --environmentName 4be50206-9576-4237-8b17-38d8aadfaa36 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --bypass false --force ``` ## Response diff --git a/docs/docs/cmd/pa/app/app-export.mdx b/docs/docs/cmd/pa/app/app-export.mdx index a0123356516..037d7fbdcbd 100644 --- a/docs/docs/cmd/pa/app/app-export.mdx +++ b/docs/docs/cmd/pa/app/app-export.mdx @@ -16,7 +16,7 @@ m365 pa app export [options] `-i, --id ` : The id of the Power App to export -`-e, --environment ` +`-e, --environmentName ` : The name of the environment for which to export the app `-n, --packageDisplayName [packageDisplayName]` @@ -42,13 +42,13 @@ m365 pa app export [options] Export the specified Power App as a ZIP file ```sh -m365 pa app export --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 3989cb59-ce1a-4a5c-bb78-257c5c39381d +m365 pa app export --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 3989cb59-ce1a-4a5c-bb78-257c5c39381d --packageDisplayName "PowerApp" ``` Export the specified Power App as a ZIP file with the package displayname, package description, the one who created it, the package source environment and the path ```sh -m365 pa app export --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 3989cb59-ce1a-4a5c-bb78-257c5c39381d --packageDisplayName "PowerApp" --packageDescription "Power App Description" --packageCreatedBy "John Doe" --packageSourceEnvironment "Contoso" --path "C:/Users/John/Documents" +m365 pa app export --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 3989cb59-ce1a-4a5c-bb78-257c5c39381d --packageDisplayName "PowerApp" --packageDescription "Power App Description" --packageCreatedBy "John Doe" --packageSourceEnvironment "Contoso" --path "C:/Users/John/Documents" ``` ## Response diff --git a/docs/docs/cmd/pa/app/app-list.mdx b/docs/docs/cmd/pa/app/app-list.mdx index afd9003bc48..60454bf9e72 100644 --- a/docs/docs/cmd/pa/app/app-list.mdx +++ b/docs/docs/cmd/pa/app/app-list.mdx @@ -15,7 +15,7 @@ m365 pa app list [options] ## Options ```md definition-list -`-e, --environment [environment]` +`-e, --environmentName [environmentName]` : The name of the environment for which to retrieve available apps `--asAdmin` @@ -47,7 +47,7 @@ m365 pa app list List all apps in a given environment ```sh -m365 pa app list --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --asAdmin +m365 pa app list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --asAdmin ``` ## Response diff --git a/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-get.mdx b/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-get.mdx index c153e16df3e..aae11efa05f 100644 --- a/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-get.mdx +++ b/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-get.mdx @@ -15,7 +15,7 @@ m365 pp aibuildermodel get [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment `-i, --id [id]` @@ -35,13 +35,13 @@ m365 pp aibuildermodel get [options] Get an AI Builder model in a specific environment ```sh -m365 pp aibuildermodel get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "Document Processing 11/29/2022, 12:58:43 PM" +m365 pp aibuildermodel get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "Document Processing 11/29/2022, 12:58:43 PM" ``` Get an AI Builder models in a specific environment by id as admin ```sh -m365 pp aibuildermodel get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "08ffffbe-ec1c-4e64-b64b-dd1db926c613" --asAdmin +m365 pp aibuildermodel get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "08ffffbe-ec1c-4e64-b64b-dd1db926c613" --asAdmin ``` ## Response @@ -111,7 +111,7 @@ m365 pp aibuildermodel get --environment "Default-d87a7535-dd31-4437-bfe1-95340a ```md - # pp aibuildermodel get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "08ffffbe-ec1c-4e64-b64b-dd1db926c613" + # pp aibuildermodel get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "08ffffbe-ec1c-4e64-b64b-dd1db926c613" Date: 6/2/2023 diff --git a/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-list.mdx b/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-list.mdx index ed398411dc7..5d46c323a92 100644 --- a/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-list.mdx +++ b/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-list.mdx @@ -15,7 +15,7 @@ m365 pp aibuildermodel list [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment `--asAdmin` @@ -29,13 +29,13 @@ m365 pp aibuildermodel list [options] List all AI Builder models in a specific environment ```sh -m365 pp aibuildermodel list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" +m365 pp aibuildermodel list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" ``` List all AI Builder models in a specific environment as admin ```sh -m365 pp aibuildermodel list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --asAdmin +m365 pp aibuildermodel list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --asAdmin ``` ## Response @@ -107,7 +107,7 @@ m365 pp aibuildermodel list --environment "Default-d87a7535-dd31-4437-bfe1-95340 ```md - # pp aibuildermodel list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" + # pp aibuildermodel list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.mdx b/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.mdx index 4e082ab8bb1..dd7d9ebe7d4 100644 --- a/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.mdx +++ b/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.mdx @@ -13,7 +13,7 @@ m365 pp aibuildermodel remove [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i, --id [id]` @@ -36,19 +36,19 @@ m365 pp aibuildermodel remove [options] Removes the AI builder model owned by the currently signed-in user based on the name parameter ```sh -m365 pp aibuildermodel remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "AI Builder Model Name" +m365 pp aibuildermodel remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "AI Builder Model Name" ``` Removes the AI builder model owned by the currently signed-in user based on the name parameter without confirmation ```sh -m365 pp aibuildermodel remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "AI Builder Model Name" --force +m365 pp aibuildermodel remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "AI Builder Model Name" --force ``` Removes the AI builder model owned by another user based on the id parameter ```sh -m365 pp aibuildermodel remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --asAdmin +m365 pp aibuildermodel remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --asAdmin ``` diff --git a/docs/docs/cmd/pp/card/card-clone.mdx b/docs/docs/cmd/pp/card/card-clone.mdx index 1ec0656a398..f8d10ea02c8 100644 --- a/docs/docs/cmd/pp/card/card-clone.mdx +++ b/docs/docs/cmd/pp/card/card-clone.mdx @@ -15,7 +15,7 @@ m365 pp card clone [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `--newName ` @@ -38,25 +38,25 @@ m365 pp card clone [options] Clones a specific card in a specific environment based on name. ```sh -m365 pp card clone --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" --newName "CLI 365 new Card" +m365 pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" --newName "CLI 365 new Card" ``` Clones a specific card in a specific environment based on name as admin. ```sh -m365 pp card clone --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" --newName "CLI 365 new Card" --asAdmin +m365 pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" --newName "CLI 365 new Card" --asAdmin ``` Clones a specific card in a specific environment based on id. ```sh -m365 pp card clone --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --newName "CLI 365 new Card" +m365 pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --newName "CLI 365 new Card" ``` Clones a specific card in a specific environment based on id as admin. ```sh -m365 pp card clone --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --newName "CLI 365 new Card" --asAdmin +m365 pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --newName "CLI 365 new Card" --asAdmin ``` ## Response @@ -89,7 +89,7 @@ m365 pp card clone --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" ```md - # pp card clone --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --newName "CLI 365 new Card" + # pp card clone --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --newName "CLI 365 new Card" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/card/card-get.mdx b/docs/docs/cmd/pp/card/card-get.mdx index e3aadcf9491..71652a7a5c7 100644 --- a/docs/docs/cmd/pp/card/card-get.mdx +++ b/docs/docs/cmd/pp/card/card-get.mdx @@ -15,7 +15,7 @@ m365 pp card get [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i, --id [id]` @@ -35,25 +35,25 @@ m365 pp card get [options] Get a specific card in a specific environment based on name ```sh -m365 pp card get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" +m365 pp card get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" ``` Get a specific card in a specific environment based on name as admin ```sh -m365 pp card get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" --asAdmin +m365 pp card get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Card" --asAdmin ``` Get a specific card in a specific environment based on id ```sh -m365 pp card get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" +m365 pp card get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" ``` Get a specific card in a specific environment based on id as admin ```sh -m365 pp card get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --asAdmin +m365 pp card get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "408e3f42-4c9e-4c93-8aaf-3cbdea9179aa" --asAdmin ``` ## Response @@ -134,7 +134,7 @@ m365 pp card get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" -- ```md - # pp card get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "0eab9392-7354-ed11-bba2-000d3adf774e" + # pp card get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "0eab9392-7354-ed11-bba2-000d3adf774e" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/card/card-list.mdx b/docs/docs/cmd/pp/card/card-list.mdx index 71db5d8b6a2..2ad3631b3eb 100644 --- a/docs/docs/cmd/pp/card/card-list.mdx +++ b/docs/docs/cmd/pp/card/card-list.mdx @@ -15,7 +15,7 @@ m365 pp card list [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `--asAdmin` @@ -29,13 +29,13 @@ m365 pp card list [options] List cards in a specific environment. ```sh -m365 pp card list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" +m365 pp card list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" ``` List cards in a specific environment as admin. ```sh -m365 pp card list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --asAdmin +m365 pp card list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --asAdmin ``` ## Response @@ -116,7 +116,7 @@ m365 pp card list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" - ```md - # pp card list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" + # pp card list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/card/card-remove.mdx b/docs/docs/cmd/pp/card/card-remove.mdx index e4d443e3244..293ae9bccbe 100644 --- a/docs/docs/cmd/pp/card/card-remove.mdx +++ b/docs/docs/cmd/pp/card/card-remove.mdx @@ -13,7 +13,7 @@ m365 pp card remove [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i, --id [id]` @@ -36,49 +36,49 @@ m365 pp card remove [options] Removes the specified Microsoft Power Platform card owned by the currently signed-in user based on the name parameter ```sh -m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Card Name" +m365 pp card remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Card Name" ``` Removes the specified Microsoft Power Platform card owned by the currently signed-in user based on the name parameter without confirmation ```sh -m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Card Name" --force +m365 pp card remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Card Name" --force ``` Removes the specified Microsoft Power Platform card owned by another user based on the name parameter ```sh -m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Card Name" --asAdmin +m365 pp card remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Card Name" --asAdmin ``` Removes the specified Microsoft Power Platform card owned by another user based on the name parameter without confirmation ```sh -m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Card Name" --asAdmin --force +m365 pp card remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Card Name" --asAdmin --force ``` Removes the specified Microsoft Power Platform card owned by the currently signed-in user based on the id parameter ```sh -m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e +m365 pp card remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e ``` Removes the specified Microsoft Power Platform card owned by the currently signed-in user based on the id parameter without confirmation ```sh -m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --force +m365 pp card remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --force ``` Removes the specified Microsoft Power Platform card owned by another user based on the id parameter ```sh -m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --asAdmin +m365 pp card remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --asAdmin ``` Removes the specified Microsoft Power Platform card owned by another user based on the id parameter without confirmation ```sh -m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --asAdmin --force +m365 pp card remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --asAdmin --force ``` ## Response diff --git a/docs/docs/cmd/pp/chatbot/chatbot-get.mdx b/docs/docs/cmd/pp/chatbot/chatbot-get.mdx index 8a7ce9c9cbc..e374529f695 100644 --- a/docs/docs/cmd/pp/chatbot/chatbot-get.mdx +++ b/docs/docs/cmd/pp/chatbot/chatbot-get.mdx @@ -15,7 +15,7 @@ m365 pp chatbot get [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i, --id [id]` @@ -35,25 +35,25 @@ m365 pp chatbot get [options] Get a specific chatbot in a specific environment based on name ```sh -m365 pp chatbot get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Chatbot" +m365 pp chatbot get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Chatbot" ``` Get a specific chatbot in a specific environment based on name as admin ```sh -m365 pp chatbot get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Chatbot" --asAdmin +m365 pp chatbot get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "CLI 365 Chatbot" --asAdmin ``` Get a specific chatbot in a specific environment based on id ```sh -m365 pp chatbot get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "3a081d91-5ea8-40a7-8ac9-abbaa3fcb893" +m365 pp chatbot get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "3a081d91-5ea8-40a7-8ac9-abbaa3fcb893" ``` Get a specific chatbot in a specific environment based on id as admin ```sh -m365 pp chatbot get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "3a081d91-5ea8-40a7-8ac9-abbaa3fcb893" --asAdmin +m365 pp chatbot get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "3a081d91-5ea8-40a7-8ac9-abbaa3fcb893" --asAdmin ``` ## Response @@ -135,7 +135,7 @@ m365 pp chatbot get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" ```md - # pp chatbot get --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "3a081d91-5ea8-40a7-8ac9-abbaa3fcb893" + # pp chatbot get --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --id "3a081d91-5ea8-40a7-8ac9-abbaa3fcb893" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/chatbot/chatbot-list.mdx b/docs/docs/cmd/pp/chatbot/chatbot-list.mdx index 892715d2657..275b24359ff 100644 --- a/docs/docs/cmd/pp/chatbot/chatbot-list.mdx +++ b/docs/docs/cmd/pp/chatbot/chatbot-list.mdx @@ -15,7 +15,7 @@ m365 pp chatbot list [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `--asAdmin` @@ -29,13 +29,13 @@ m365 pp chatbot list [options] List chatbots in a specific environment. ```sh -m365 pp chatbot list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" +m365 pp chatbot list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" ``` List chatbots in a specific environment as admin. ```sh -m365 pp chatbot list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --asAdmin +m365 pp chatbot list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --asAdmin ``` ## Response @@ -94,7 +94,7 @@ m365 pp chatbot list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5 ```md - # pp chatbot list --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" + # pp chatbot list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/chatbot/chatbot-remove.mdx b/docs/docs/cmd/pp/chatbot/chatbot-remove.mdx index 8ac11e1a145..ceb2eb30ad6 100644 --- a/docs/docs/cmd/pp/chatbot/chatbot-remove.mdx +++ b/docs/docs/cmd/pp/chatbot/chatbot-remove.mdx @@ -13,7 +13,7 @@ m365 pp chatbot remove [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i, --id [id]` @@ -36,19 +36,19 @@ m365 pp chatbot remove [options] Removes the specified Microsoft Power Platform chatbot owned by the currently signed-in user based on name ```sh -m365 pp chatbot remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Chatbot Name" +m365 pp chatbot remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Chatbot Name" ``` Removes the specified Microsoft Power Platform chatbot owned by the currently signed-in user based on id without confirmation ```sh -m365 pp chatbot remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --force +m365 pp chatbot remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --force ``` Removes the specified Microsoft Power Platform chatbot owned by another user based on name ```sh -m365 pp chatbot remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Chatbot Name" --asAdmin +m365 pp chatbot remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Chatbot Name" --asAdmin ``` ## Response diff --git a/docs/docs/cmd/pp/dataverse/dataverse-table-get.mdx b/docs/docs/cmd/pp/dataverse/dataverse-table-get.mdx index 6c1026690b5..fcb2e04ba46 100644 --- a/docs/docs/cmd/pp/dataverse/dataverse-table-get.mdx +++ b/docs/docs/cmd/pp/dataverse/dataverse-table-get.mdx @@ -15,7 +15,7 @@ m365 pp dataverse table get [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment to list a table for. `-n, --name` @@ -32,13 +32,13 @@ m365 pp dataverse table get [options] List a table for the given environment ```sh -m365 pp dataverse table get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" +m365 pp dataverse table get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" ``` List a table for the given environment as Admin ```sh -m365 pp dataverse table get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --asAdmin +m365 pp dataverse table get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --asAdmin ``` ## Response @@ -132,7 +132,7 @@ m365 pp dataverse table get --environment "Default-2ca3eaa5-140f-4175-8261-3272e ```md - # pp dataverse table get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" + # pp dataverse table get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/dataverse/dataverse-table-list.mdx b/docs/docs/cmd/pp/dataverse/dataverse-table-list.mdx index b61c859175e..d759932a218 100644 --- a/docs/docs/cmd/pp/dataverse/dataverse-table-list.mdx +++ b/docs/docs/cmd/pp/dataverse/dataverse-table-list.mdx @@ -15,7 +15,7 @@ m365 pp dataverse table list [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment to list all tables for `--asAdmin` @@ -29,13 +29,13 @@ m365 pp dataverse table list [options] List all tables for the given environment ```sh -m365 pp dataverse table list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" +m365 pp dataverse table list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" ``` List all tables for the given environment as Admin ```sh -m365 pp dataverse table list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin +m365 pp dataverse table list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin ``` ## Response @@ -130,7 +130,7 @@ m365 pp dataverse table list --environment "Default-2ca3eaa5-140f-4175-8261-3272 ```md - # pp dataverse table list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" + # pp dataverse table list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx b/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx index 08f36a11ed4..779837bd901 100644 --- a/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx +++ b/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx @@ -13,7 +13,7 @@ m365 pp dataverse table remove [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment to remove a table from. `-n, --name` @@ -33,19 +33,19 @@ m365 pp dataverse table remove [options] Removes a dataverse table in a given environment ```sh -m365 pp dataverse table remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" +m365 pp dataverse table remove --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" ``` Removes a dataverse table in a given environment as Admin ```sh -m365 pp dataverse table remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --asAdmin +m365 pp dataverse table remove --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --asAdmin ``` Removes a dataverse table in a given environment without prompting for confirmation ```sh -m365 pp dataverse table remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --force +m365 pp dataverse table remove --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --force ``` ## Response diff --git a/docs/docs/cmd/pp/dataverse/dataverse-table-row-list.mdx b/docs/docs/cmd/pp/dataverse/dataverse-table-row-list.mdx index f60b4a2b471..68d07255fbd 100644 --- a/docs/docs/cmd/pp/dataverse/dataverse-table-row-list.mdx +++ b/docs/docs/cmd/pp/dataverse/dataverse-table-row-list.mdx @@ -15,7 +15,7 @@ m365 pp dataverse table row list [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment `--entitySetName [entitySetName]` @@ -35,19 +35,19 @@ m365 pp dataverse table row list [options] List all table rows for the given environment based on the entity set name ```sh -m365 pp dataverse table row list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --entitySetName "cr6c3_accounts" +m365 pp dataverse table row list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --entitySetName "cr6c3_accounts" ``` List all table rows for the given environment based on the table name ```sh -m365 pp dataverse table row list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --tableName "cr6c3_account" +m365 pp dataverse table row list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --tableName "cr6c3_account" ``` List all table rows for the given environment based on the entity set name as Admin ```sh -m365 pp dataverse table row list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --entitySetName "cr6c3_accounts" --asAdmin +m365 pp dataverse table row list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --entitySetName "cr6c3_accounts" --asAdmin ``` ## Response @@ -102,7 +102,7 @@ m365 pp dataverse table row list --environment "Default-2ca3eaa5-140f-4175-8261- ```md - # pp dataverse table row list --environment "Default-0cac6cda-2e04-4a3d-9c16-9c91470d7022" --tableName "cr6c3_accounts" + # pp dataverse table row list --environmentName "Default-0cac6cda-2e04-4a3d-9c16-9c91470d7022" --tableName "cr6c3_accounts" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/dataverse/dataverse-table-row-remove.mdx b/docs/docs/cmd/pp/dataverse/dataverse-table-row-remove.mdx index 5d2df7982aa..deaa66f7274 100644 --- a/docs/docs/cmd/pp/dataverse/dataverse-table-row-remove.mdx +++ b/docs/docs/cmd/pp/dataverse/dataverse-table-row-remove.mdx @@ -13,7 +13,7 @@ m365 pp dataverse table row remove [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment to remove a row from a table from. `-i, --id ` @@ -39,25 +39,25 @@ m365 pp dataverse table row remove [options] Removes a row from a dataverse table in a given environment ```sh -m365 pp dataverse table row remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --tableName "aadusers" --id "21d01cf4-356c-ed11-9561-000d3a4bbea4" +m365 pp dataverse table row remove --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --tableName "aadusers" --id "21d01cf4-356c-ed11-9561-000d3a4bbea4" ``` Removes a row from a dataverse table in a given environment as Admin ```sh -m365 pp dataverse table row remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --tableName "aadusers" --id "21d01cf4-356c-ed11-9561-000d3a4bbea4" --asAdmin +m365 pp dataverse table row remove --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --tableName "aadusers" --id "21d01cf4-356c-ed11-9561-000d3a4bbea4" --asAdmin ``` Removes a row from a dataverse table in a given environment without prompting for confirmation ```sh -m365 pp dataverse table row remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --tableName "aadusers" --id "21d01cf4-356c-ed11-9561-000d3a4bbea4" --force +m365 pp dataverse table row remove --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --tableName "aadusers" --id "21d01cf4-356c-ed11-9561-000d3a4bbea4" --force ``` Removes a row from a dataverse table in a given environment based on the entity set name without prompting for confirmation ```sh -m365 pp dataverse table row remove --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --entitySetName "cr6c3_accounts" --id "21d01cf4-356c-ed11-9561-000d3a4bbea4" --force +m365 pp dataverse table row remove --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --entitySetName "cr6c3_accounts" --id "21d01cf4-356c-ed11-9561-000d3a4bbea4" --force ``` ## Response diff --git a/docs/docs/cmd/pp/solution/solution-get.mdx b/docs/docs/cmd/pp/solution/solution-get.mdx index 6114ba25346..66f8dacc771 100644 --- a/docs/docs/cmd/pp/solution/solution-get.mdx +++ b/docs/docs/cmd/pp/solution/solution-get.mdx @@ -15,7 +15,7 @@ m365 pp solution get [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i --id [id]` @@ -35,25 +35,25 @@ m365 pp solution get [options] Gets a specific solution in a specific environment based on name ```sh -m365 pp solution get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "Default" +m365 pp solution get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "Default" ``` Gets a specific solution in a specific environment based on name as Admin ```sh -m365 pp solution get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "Default" --asAdmin +m365 pp solution get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "Default" --asAdmin ``` Gets a specific solution in a specific environment based on id ```sh -m365 pp solution get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" +m365 pp solution get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" ``` Gets a specific solution in a specific environment based on id as Admin ```sh -m365 pp solution get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" --asAdmin +m365 pp solution get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" --asAdmin ``` ## Response @@ -98,7 +98,7 @@ m365 pp solution get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339 ```md - # pp solution get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" + # pp solution get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/solution/solution-list.mdx b/docs/docs/cmd/pp/solution/solution-list.mdx index 32031fc5fee..7ecd4f9b21a 100644 --- a/docs/docs/cmd/pp/solution/solution-list.mdx +++ b/docs/docs/cmd/pp/solution/solution-list.mdx @@ -15,7 +15,7 @@ m365 pp solution list [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment `--asAdmin` @@ -29,13 +29,13 @@ m365 pp solution list [options] List all solutions in a specific environment ```sh -m365 pp solution list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" +m365 pp solution list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" ``` List all solutions in a specific environment as Admin ```sh -m365 pp solution list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin +m365 pp solution list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin ``` ## Response @@ -82,7 +82,7 @@ m365 pp solution list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f33 ```md - # pp solution list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" + # pp solution list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/solution/solution-publish.mdx b/docs/docs/cmd/pp/solution/solution-publish.mdx index b5336728250..31fce42ba28 100644 --- a/docs/docs/cmd/pp/solution/solution-publish.mdx +++ b/docs/docs/cmd/pp/solution/solution-publish.mdx @@ -13,7 +13,7 @@ m365 pp solution publish [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i, --id [id]` @@ -36,19 +36,19 @@ m365 pp solution publish [options] Publishes the components of a specified solution with a specific name, owned by the currently signed-in user ```sh -m365 pp solution publish --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" +m365 pp solution publish --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" ``` Publishes the components of a specified solution owned by the currently signed-in user based on the id parameter and waits for completion ```sh -m365 pp solution publish --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b --wait +m365 pp solution publish --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b --wait ``` Publishes the components of a specified solution owned by another user based on the name parameter ```sh -m365 pp solution publish --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" --asAdmin +m365 pp solution publish --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" --asAdmin ``` ## Response diff --git a/docs/docs/cmd/pp/solution/solution-publisher-add.mdx b/docs/docs/cmd/pp/solution/solution-publisher-add.mdx index 18405da893e..d2b1cb7e38d 100644 --- a/docs/docs/cmd/pp/solution/solution-publisher-add.mdx +++ b/docs/docs/cmd/pp/solution/solution-publisher-add.mdx @@ -13,7 +13,7 @@ m365 pp solution publisher add [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-n, --name ` @@ -39,13 +39,13 @@ m365 pp solution publisher add [options] Add a specific publisher in a specific environment ```sh -m365 pp solution publisher add --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "Contoso" --displayName "Contoso" --prefix "new" --choiceValuePrefix 10000 +m365 pp solution publisher add --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "Contoso" --displayName "Contoso" --prefix "new" --choiceValuePrefix 10000 ``` Adds a specific publisher in a specific environment as Admin ```sh -m365 pp solution publisher add --environment "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "Contoso" --displayName "Contoso" --prefix "new" --choiceValuePrefix 10000 --asAdmin +m365 pp solution publisher add --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd55c5" --name "Contoso" --displayName "Contoso" --prefix "new" --choiceValuePrefix 10000 --asAdmin ``` ## Response diff --git a/docs/docs/cmd/pp/solution/solution-publisher-get.mdx b/docs/docs/cmd/pp/solution/solution-publisher-get.mdx index e0cbcc907b8..03104e35b6e 100644 --- a/docs/docs/cmd/pp/solution/solution-publisher-get.mdx +++ b/docs/docs/cmd/pp/solution/solution-publisher-get.mdx @@ -15,7 +15,7 @@ m365 pp solution publisher get [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i --id [id]` @@ -35,25 +35,25 @@ m365 pp solution publisher get [options] Gets a specific publisher in a specific environment based on name ```sh -m365 pp solution publisher get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "MicrosoftCorporation" +m365 pp solution publisher get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "MicrosoftCorporation" ``` Gets a specific publisher in a specific environment based on name as Admin ```sh -m365 pp solution publisher get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "MicrosoftCorporation" --asAdmin +m365 pp solution publisher get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "MicrosoftCorporation" --asAdmin ``` Gets a specific publisher in a specific environment based on id ```sh -m365 pp solution publisher get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" +m365 pp solution publisher get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" ``` Gets a specific publisher in a specific environment based on id as Admin ```sh -m365 pp solution publisher get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" --asAdmin +m365 pp solution publisher get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "ee62fd63-e49e-4c09-80de-8fae1b9a427e" --asAdmin ``` ## Response @@ -95,7 +95,7 @@ m365 pp solution publisher get --environment "Default-2ca3eaa5-140f-4175-8261-32 ```md - # pp solution publisher get --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "d21aab70-79e7-11dd-8874-00188b01e34f" + # pp solution publisher get --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --id "d21aab70-79e7-11dd-8874-00188b01e34f" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/solution/solution-publisher-list.mdx b/docs/docs/cmd/pp/solution/solution-publisher-list.mdx index 97895e8dd0b..f904c0c9420 100644 --- a/docs/docs/cmd/pp/solution/solution-publisher-list.mdx +++ b/docs/docs/cmd/pp/solution/solution-publisher-list.mdx @@ -15,7 +15,7 @@ m365 pp solution publisher list [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment `--includeMicrosoftPublishers` @@ -32,13 +32,13 @@ m365 pp solution publisher list [options] List all publishers in a specific environment ```sh -m365 pp solution publisher list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" +m365 pp solution publisher list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" ``` List all publishers in a specific environment as Admin ```sh -m365 pp solution publisher list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin +m365 pp solution publisher list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --asAdmin ``` ## Response @@ -82,7 +82,7 @@ m365 pp solution publisher list --environment "Default-2ca3eaa5-140f-4175-8261-3 ```md - # pp solution publisher list --environment "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" + # pp solution publisher list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" Date: 9/1/2023 diff --git a/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx b/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx index 3fcec4e6fde..f7d82ef65a8 100644 --- a/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx +++ b/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx @@ -13,7 +13,7 @@ m365 pp solution publisher remove [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i, --id [id]` @@ -36,25 +36,25 @@ m365 pp solution publisher remove [options] Removes the specified publisher based on the name parameter ```sh -m365 pp solution publisher remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Publisher Name" +m365 pp solution publisher remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Publisher Name" ``` Removes the specified publisher based on the name parameter without confirmation ```sh -m365 pp solution publisher remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Publisher Name" --force +m365 pp solution publisher remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Publisher Name" --force ``` Removes the specified publisher based on the name parameter as admin ```sh -m365 pp solution publisher remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Publisher Name" --asAdmin +m365 pp solution publisher remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Publisher Name" --asAdmin ``` Removes the specified publisher owned by the currently signed-in user based on the id parameter ```sh -m365 pp solution publisher remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b +m365 pp solution publisher remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b ``` ## Response diff --git a/docs/docs/cmd/pp/solution/solution-remove.mdx b/docs/docs/cmd/pp/solution/solution-remove.mdx index 9843dabb690..8f97a5d4a54 100644 --- a/docs/docs/cmd/pp/solution/solution-remove.mdx +++ b/docs/docs/cmd/pp/solution/solution-remove.mdx @@ -13,7 +13,7 @@ m365 pp solution remove [options] ## Options ```md definition-list -`-e, --environment ` +`-e, --environmentName ` : The name of the environment. `-i, --id [id]` @@ -36,49 +36,49 @@ m365 pp solution remove [options] Removes the specified solution with a specific name, owned by the currently signed-in user ```sh -m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" +m365 pp solution remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" ``` Removes the specified solution owned by the currently signed-in user based on the name parameter without confirmation ```sh -m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" --force +m365 pp solution remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" --force ``` Removes the specified solution owned by another user based on the name parameter ```sh -m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" --asAdmin +m365 pp solution remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" --asAdmin ``` Removes the specified solution owned by another user based on the name parameter without confirmation ```sh -m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "solution Name" --asAdmin --force +m365 pp solution remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "solution Name" --asAdmin --force ``` Removes the specified solution owned by the currently signed-in user based on the id parameter ```sh -m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b +m365 pp solution remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b ``` Removes the specified solution owned by the currently signed-in user based on the id parameter without confirmation ```sh -m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b --force +m365 pp solution remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b --force ``` Removes the specified solution owned by another user based on the id parameter ```sh -m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b --asAdmin +m365 pp solution remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b --asAdmin ``` Removes the specified solution owned by another user based on the id parameter without confirmation ```sh -m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b --asAdmin --force +m365 pp solution remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b --asAdmin --force ``` ## Response diff --git a/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx b/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx index 626bc498c6e..f1ff780b76c 100644 --- a/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx +++ b/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx @@ -27,7 +27,7 @@ m365 spo listitem attachment list [options] `--listUrl [listUrl]` : Server- or site-relative URL of the list. Specify either `listTitle`, `listId` or `listUrl` -`--itemId ` +`--listItemId ` : ID of the list item ``` @@ -35,22 +35,22 @@ m365 spo listitem attachment list [options] ## Examples -Gets the attachments from list item with itemId _147_ in list with title _Demo List_ in site _https://contoso.sharepoint.com/sites/project-x_ +Gets the attachments from list item with listItemId _147_ in list with title _Demo List_ in site _https://contoso.sharepoint.com/sites/project-x_ ```sh -m365 spo listitem attachment list --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle "Demo List" --itemId 147 +m365 spo listitem attachment list --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle "Demo List" --listItemId 147 ``` -Gets the attachments from list item with itemId _147_ in list with id _0cd891ef-afce-4e55-b836-fce03286cccf_ in site _https://contoso.sharepoint.com/sites/project-x_ +Gets the attachments from list item with listItemId _147_ in list with id _0cd891ef-afce-4e55-b836-fce03286cccf_ in site _https://contoso.sharepoint.com/sites/project-x_ ```sh -m365 spo listitem attachment list --webUrl https://contoso.sharepoint.com/sites/project-x --listId 0cd891ef-afce-4e55-b836-fce03286cccf --itemId 147 +m365 spo listitem attachment list --webUrl https://contoso.sharepoint.com/sites/project-x --listId 0cd891ef-afce-4e55-b836-fce03286cccf --listItemId 147 ``` Gets the attachments from a specific list item in a specific list obtained by server-relative URL in a specific site ```sh -m365 spo listitem attachment list --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl /sites/project-x/Documents --itemId 147 +m365 spo listitem attachment list --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl /sites/project-x/Documents --listItemId 147 ``` ## Response @@ -94,7 +94,7 @@ m365 spo listitem attachment list --webUrl https://contoso.sharepoint.com/sites/ ```md - # spo listitem attachment list --webUrl "https://contoso.sharepoint.com" --listTitle "Test" --itemId "236" + # spo listitem attachment list --webUrl "https://contoso.sharepoint.com" --listTitle "Test" --listItemId "236" Date: 2/20/2023 diff --git a/docs/docs/cmd/spo/user/user-get.mdx b/docs/docs/cmd/spo/user/user-get.mdx index a15d9ebc301..4d9b98fc176 100644 --- a/docs/docs/cmd/spo/user/user-get.mdx +++ b/docs/docs/cmd/spo/user/user-get.mdx @@ -19,13 +19,13 @@ m365 spo user get [options] : URL of the web to get the user within `-i, --id [id]` -: ID of the user to retrieve information for. Use either `email`, `id` or `loginName`, but not all. +: ID of the user to retrieve information for. Use either `email`, `id` or `userName`, but not all. `--email [email]` -: Email of the user to retrieve information for. Use either `email`, `id` or `loginName`, but not all. +: Email of the user to retrieve information for. Use either `email`, `id` or `userName`, but not all. -`--loginName [loginName]` -: Login name of the user to retrieve information for. Use either `email`, `id` or `loginName`, but not all. +`--userName [userName]` +: Login name of the user to retrieve information for. Use either `email`, `id` or `userName`, but not all. ``` @@ -47,7 +47,7 @@ m365 spo user get --webUrl https://contoso.sharepoint.com/sites/project-x --id 6 Get user with login name 'i:0#.f|membership|john.doe@mytenant.onmicrosoft.com' for a web ```sh -m365 spo user get --webUrl https://contoso.sharepoint.com/sites/project-x --loginName "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" +m365 spo user get --webUrl https://contoso.sharepoint.com/sites/project-x --userName "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" ``` ## Response @@ -105,7 +105,7 @@ m365 spo user get --webUrl https://contoso.sharepoint.com/sites/project-x --logi ```md - # spo user get --webUrl "https://contoso.sharepoint.com" --loginName "i:0#.f|membership|john.doe@contoso.onmicrosoft.com" + # spo user get --webUrl "https://contoso.sharepoint.com" --userName "i:0#.f|membership|john.doe@contoso.onmicrosoft.com" Date: 4/10/2023 diff --git a/docs/docs/sample-scripts/powerplatform/list-environments-flows-apps/assets/sample.json b/docs/docs/sample-scripts/powerplatform/list-environments-flows-apps/assets/sample.json index 0174866b313..fd275c0ec24 100644 --- a/docs/docs/sample-scripts/powerplatform/list-environments-flows-apps/assets/sample.json +++ b/docs/docs/sample-scripts/powerplatform/list-environments-flows-apps/assets/sample.json @@ -22,7 +22,7 @@ "metadata": [ { "key": "CLI-FOR-MICROSOFT365", - "value": "6.3.0" + "value": "7.0.0" } ], "thumbnails": [ diff --git a/docs/docs/sample-scripts/powerplatform/list-environments-flows-apps/index.mdx b/docs/docs/sample-scripts/powerplatform/list-environments-flows-apps/index.mdx index 84923c40280..30fb813db6f 100644 --- a/docs/docs/sample-scripts/powerplatform/list-environments-flows-apps/index.mdx +++ b/docs/docs/sample-scripts/powerplatform/list-environments-flows-apps/index.mdx @@ -45,7 +45,7 @@ This script will retrieve all environments as an Administrator and loop through createdByUpn = $_.properties.createdBy.userPrincipalName ? $_.properties.createdBy.userPrincipalName : "" } - $apps = m365 pa app list --environment $envId --asAdmin | ConvertFrom-Json + $apps = m365 pa app list --environmentName $envId --asAdmin | ConvertFrom-Json Write-Host -f Green "Processing: $($apps.Count) apps" $apps | ForEach-Object { diff --git a/docs/docs/sample-scripts/spo/download-attachments-from-list/assets/sample.json b/docs/docs/sample-scripts/spo/download-attachments-from-list/assets/sample.json index c972d8c5c87..72fd25cad93 100644 --- a/docs/docs/sample-scripts/spo/download-attachments-from-list/assets/sample.json +++ b/docs/docs/sample-scripts/spo/download-attachments-from-list/assets/sample.json @@ -22,7 +22,7 @@ "metadata": [ { "key": "CLI-FOR-MICROSOFT365", - "value": "6.3.0" + "value": "7.0.0" } ], "thumbnails": [ diff --git a/docs/docs/sample-scripts/spo/download-attachments-from-list/index.mdx b/docs/docs/sample-scripts/spo/download-attachments-from-list/index.mdx index 247968aa6fb..fdc3e5b5291 100644 --- a/docs/docs/sample-scripts/spo/download-attachments-from-list/index.mdx +++ b/docs/docs/sample-scripts/spo/download-attachments-from-list/index.mdx @@ -43,7 +43,7 @@ Download attachments from a SharePoint Online list. Foreach ($Item in $ListItems) { #Get All attachments from the List Item - $Attachments = m365 spo listitem attachment list --webUrl $SiteURL --listTitle $ListTitle --itemId $Item.Id | ConvertFrom-Json + $Attachments = m365 spo listitem attachment list --webUrl $SiteURL --listTitle $ListTitle --listItemId $Item.Id | ConvertFrom-Json foreach ($Attachment in $Attachments) { $TargetFilePath = "$($DownloadDirectory)/$($Item.Id)_$($Attachment.FileName)" #Download attachment diff --git a/docs/docs/sample-scripts/spo/list-attachment-names-from-spo-lists/assets/sample.json b/docs/docs/sample-scripts/spo/list-attachment-names-from-spo-lists/assets/sample.json index 6b1b257012e..8835a1fdb38 100644 --- a/docs/docs/sample-scripts/spo/list-attachment-names-from-spo-lists/assets/sample.json +++ b/docs/docs/sample-scripts/spo/list-attachment-names-from-spo-lists/assets/sample.json @@ -22,7 +22,7 @@ "metadata": [ { "key": "CLI-FOR-MICROSOFT365", - "value": "6.3.0" + "value": "7.0.0" } ], "thumbnails": [ diff --git a/docs/docs/sample-scripts/spo/list-attachment-names-from-spo-lists/index.mdx b/docs/docs/sample-scripts/spo/list-attachment-names-from-spo-lists/index.mdx index e1c5538291a..dba7c7c7c7e 100644 --- a/docs/docs/sample-scripts/spo/list-attachment-names-from-spo-lists/index.mdx +++ b/docs/docs/sample-scripts/spo/list-attachment-names-from-spo-lists/index.mdx @@ -25,7 +25,7 @@ Author: [Veronique Lengelle](https://twitter.com/veronicageek) $allItems = m365 spo listitem list --listId $list.Id --webUrl $siteUrl | ConvertFrom-Json foreach($item in $allItems){ - $allAttachments = m365 spo listitem attachment list --webUrl $siteUrl --listTitle $list.Title --itemId $item.Id | ConvertFrom-Json + $allAttachments = m365 spo listitem attachment list --webUrl $siteUrl --listTitle $list.Title --listItemId $item.Id | ConvertFrom-Json foreach($attachment in $allAttachments){ $results += [pscustomobject][ordered]@{ diff --git a/docs/docs/v7-upgrade-guidance.mdx b/docs/docs/v7-upgrade-guidance.mdx new file mode 100644 index 00000000000..51b11e99b94 --- /dev/null +++ b/docs/docs/v7-upgrade-guidance.mdx @@ -0,0 +1,46 @@ +# v7 Upgrade Guidance + +The v7 of CLI for Microsoft 365 introduces several breaking changes. To help you upgrade to the latest version of CLI for Microsoft 365, we've listed those changes along with any actions you may need to take. + +## Aligned options with naming convention + +In version 7 of the CLI for Microsoft 365, we have made updates to the options for certain commands, aligning with our naming convention. This includes renaming options to ensure consistency and improve the CLI experience. For example, the option `--environment` for the command `m365 pa app consent set` has been changed to `--environmentName`. These changes aim to make it easier for you to use the CLI. + +We've updated the following commands and options: + +Command|Old option|New option +--|--|-- +[aad user set](./cmd/aad/user/user-set.mdx)|`objectId`|`id` +[aad user set](./cmd/aad/user/user-set.mdx)|`userPrincipalName`|`userName` +[pa app consent set](./cmd/pa/app/app-consent-set.mdx)|`environment`|`environmentName` +[pa app export](./cmd/pa/app/app-export.mdx)|`environment`|`environmentName` +[pa app list](./cmd/pa/app/app-list.mdx)|`environment`|`environmentName` +[pp aibuildermodel get](./cmd/pp/aibuildermodel/aibuildermodel-get.mdx)|`environment`|`environmentName` +[pp aibuildermodel list](./cmd/pp/aibuildermodel/aibuildermodel-list.mdx)|`environment`|`environmentName` +[pp aibuildermodel remove](./cmd/pp/aibuildermodel/aibuildermodel-remove.mdx)|`environment`|`environmentName` +[pp card clone](./cmd/pp/card/card-clone.mdx)|`environment`|`environmentName` +[pp card get](./cmd/pp/card/card-get.mdx)|`environment`|`environmentName` +[pp card list](./cmd/pp/card/card-list.mdx)|`environment`|`environmentName` +[pp card remove](./cmd/pp/card/card-remove.mdx)|`environment`|`environmentName` +[pp chatbot get](./cmd/pp/chatbot/chatbot-get.mdx)|`environment`|`environmentName` +[pp chatbot list](./cmd/pp/chatbot/chatbot-list.mdx)|`environment`|`environmentName` +[pp chatbot remove](./cmd/pp/chatbot/chatbot-remove.mdx)|`environment`|`environmentName` +[pp dataverse table get](./cmd/pp/dataverse/dataverse-table-get.mdx)|`environment`|`environmentName` +[pp dataverse table list](./cmd/pp/dataverse/dataverse-table-list.mdx)|`environment`|`environmentName` +[pp dataverse table remove](./cmd/pp/dataverse/dataverse-table-remove.mdx)|`environment`|`environmentName` +[pp dataverse table row list](./cmd/pp/dataverse/dataverse-table-row-list.mdx)|`environment`|`environmentName` +[pp dataverse table row remove](./cmd/pp/dataverse/dataverse-table-row-remove.mdx)|`environment`|`environmentName` +[pp solution get](./cmd/pp/solution/solution-get.mdx)|`environment`|`environmentName` +[pp solution list](./cmd/pp/solution/solution-list.mdx)|`environment`|`environmentName` +[pp solution publish](./cmd/pp/solution/solution-publish.mdx)|`environment`|`environmentName` +[pp solution remove](./cmd/pp/solution/solution-remove.mdx)|`environment`|`environmentName` +[pp solution publisher get](./cmd/pp/solution/solution-publisher-get.mdx)|`environment`|`environmentName` +[pp solution publisher add](./cmd/pp/solution/solution-publisher-add.mdx)|`environment`|`environmentName` +[pp solution publisher list](./cmd/pp/solution/solution-publisher-list.mdx)|`environment`|`environmentName` +[pp solution publisher remove](./cmd/pp/solution/solution-publisher-remove.mdx)|`environment`|`environmentName` +[spo listitem attachment list](./cmd/spo/listitem/listitem-attachment-list.mdx)|`itemId`|`listItemId` +[spo user get](./cmd/spo/user/user-get.mdx)|`loginName`|`userName` + +### What action do I need to take? + +If you use any of the commands listed above, ensure that you use the new option names. diff --git a/docs/src/config/sidebars.js b/docs/src/config/sidebars.js index fe12a2b0b96..24d29555e8c 100644 --- a/docs/src/config/sidebars.js +++ b/docs/src/config/sidebars.js @@ -4,6 +4,7 @@ const sidebars = { home: [ 'index', + 'v7-upgrade-guidance', 'v6-upgrade-guidance', 'v5-upgrade-guidance', 'v4-upgrade-guidance', diff --git a/src/m365/aad/commands/user/user-set.spec.ts b/src/m365/aad/commands/user/user-set.spec.ts index fadd314637a..de5555656e8 100644 --- a/src/m365/aad/commands/user/user-set.spec.ts +++ b/src/m365/aad/commands/user/user-set.spec.ts @@ -18,8 +18,8 @@ const command: Command = require('./user-set'); describe(commands.USER_SET, () => { const currentPassword = '9%9OLUg6p@Ra'; const newPassword = 'iO$99OVj386i'; - const objectId = '1caf7dcd-7e83-4c3a-94f7-932a1299c844'; - const userPrincipalName = 'steve@contoso.onmicrosoft.com'; + const id = '1caf7dcd-7e83-4c3a-94f7-932a1299c844'; + const userName = 'steve@contoso.onmicrosoft.com'; const displayName = 'John'; const firstName = 'John'; const lastName = 'Doe'; @@ -96,108 +96,108 @@ describe(commands.USER_SET, () => { assert.notStrictEqual(command.description, null); }); - it('fails validation if neither the objectId nor the userPrincipalName are specified', async () => { + it('fails validation if neither the id nor the userName are specified', async () => { const actual = await command.validate({ options: {} }, commandInfo); assert.notStrictEqual(actual, true); }); - it('fails validation if both the objectId and the userPrincipalName are specified', async () => { - const actual = await command.validate({ options: { objectId: objectId, userPrincipalName: userPrincipalName } }, commandInfo); + it('fails validation if both the id and the userName are specified', async () => { + const actual = await command.validate({ options: { id: id, userName: userName } }, commandInfo); assert.notStrictEqual(actual, true); }); - it('fails validation if the objectId is not a valid GUID', async () => { - const actual = await command.validate({ options: { objectId: 'invalid' } }, commandInfo); + it('fails validation if the id is not a valid GUID', async () => { + const actual = await command.validate({ options: { id: 'invalid' } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if currentPassword is set without newPassword', async () => { - const actual = await command.validate({ options: { objectId: objectId, currentPassword: currentPassword } }, commandInfo); + const actual = await command.validate({ options: { id: id, currentPassword: currentPassword } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if newPassword is set without currentPassword', async () => { - const actual = await command.validate({ options: { objectId: objectId, newPassword: newPassword } }, commandInfo); + const actual = await command.validate({ options: { id: id, newPassword: newPassword } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if resetPassword is set without a password', async () => { - const actual = await command.validate({ options: { objectId: objectId, resetPassword: true } }, commandInfo); + const actual = await command.validate({ options: { id: id, resetPassword: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if resetPassword and password is set and currentPassword is also set', async () => { - const actual = await command.validate({ options: { objectId: objectId, resetPassword: true, password: newPassword, currentPassword: currentPassword } }, commandInfo); + const actual = await command.validate({ options: { id: id, resetPassword: true, password: newPassword, currentPassword: currentPassword } }, commandInfo); assert.notStrictEqual(actual, true); }); - it('fails validation when userPrincipalName has an invalid value', async () => { - const actual = await command.validate({ options: { userPrincipalName: 'invalid' } }, commandInfo); + it('fails validation when userName has an invalid value', async () => { + const actual = await command.validate({ options: { userName: 'invalid' } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation usageLocation is not a valid usageLocation', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, usageLocation: 'invalid' } }, commandInfo); + const actual = await command.validate({ options: { displayName: displayName, id: id, usageLocation: 'invalid' } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation preferredLanguage is not a valid preferredLanguage', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, preferredLanguage: 'z' } }, commandInfo); + const actual = await command.validate({ options: { displayName: displayName, id: id, preferredLanguage: 'z' } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if both managerUserId and managerUserName are specified', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, managerUserId: managerUserId, managerUserName: managerUserName } }, commandInfo); + const actual = await command.validate({ options: { displayName: displayName, id: id, managerUserId: managerUserId, managerUserName: managerUserName } }, commandInfo); assert.notStrictEqual(actual, true); }); - it('fails validation if managerUserName is not a valid userPrincipalName', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, managerUserName: 'invalid' } }, commandInfo); + it('fails validation if managerUserName is not a valid userName', async () => { + const actual = await command.validate({ options: { displayName: displayName, id: id, managerUserName: 'invalid' } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if managerUserId is not a valid GUID', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, managerUserId: 'invalid' } }, commandInfo); + const actual = await command.validate({ options: { displayName: displayName, id: id, managerUserId: 'invalid' } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if firstName has more than 64 characters', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, firstName: largeString } }, commandInfo); + const actual = await command.validate({ options: { displayName: displayName, id: id, firstName: largeString } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if lastName has more than 64 characters', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, lastName: largeString } }, commandInfo); + const actual = await command.validate({ options: { displayName: displayName, id: id, lastName: largeString } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if jobTitle has more than 128 characters', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, jobTitle: largeString + largeString } }, commandInfo); + const actual = await command.validate({ options: { displayName: displayName, id: id, jobTitle: largeString + largeString } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if companyName has more than 64 characters', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, companyName: largeString } }, commandInfo); + const actual = await command.validate({ options: { displayName: displayName, id: id, companyName: largeString } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if department has more than 64 characters', async () => { - const actual = await command.validate({ options: { displayName: displayName, objectId: objectId, department: largeString } }, commandInfo); + const actual = await command.validate({ options: { displayName: displayName, id: id, department: largeString } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if forceChangePasswordNextSignIn is set without resetPassword', async () => { - const actual = await command.validate({ options: { objectId: objectId, forceChangePasswordNextSignIn: true } }, commandInfo); + const actual = await command.validate({ options: { id: id, forceChangePasswordNextSignIn: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if forceChangePasswordNextSignInWithMfa is set without resetPassword', async () => { - const actual = await command.validate({ options: { objectId: objectId, forceChangePasswordNextSignInWithMfa: true } }, commandInfo); + const actual = await command.validate({ options: { id: id, forceChangePasswordNextSignInWithMfa: true } }, commandInfo); assert.notStrictEqual(actual, true); }); - it('passes validation if the objectId is a valid GUID', async () => { - const actual = await command.validate({ options: { objectId: objectId } }, commandInfo); + it('passes validation if the id is a valid GUID', async () => { + const actual = await command.validate({ options: { id: id } }, commandInfo); assert.strictEqual(actual, true); }); @@ -206,16 +206,16 @@ describe(commands.USER_SET, () => { assert.strictEqual(allowUnknownOptions, true); }); - it('throws error when objectId is not equal to current signed in objectId in Cli when passing both the options currentPassword and newPassword', async () => { + it('throws error when id is not equal to current signed in id in Cli when passing both the options currentPassword and newPassword', async () => { sinon.stub(accessToken, 'getUserIdFromAccessToken').returns('7c47b08e-e7b3-427a-9eba-b679815148e9'); - await assert.rejects(command.action(logger, { options: { verbose: true, objectId: objectId, newPassword: newPassword, currentPassword: currentPassword } } as any), - new CommandError(`You can only change your own password. Please use --objectId @meId to reference to your own userId`)); + await assert.rejects(command.action(logger, { options: { verbose: true, id: id, newPassword: newPassword, currentPassword: currentPassword } } as any), + new CommandError(`You can only change your own password. Please use --id @meId to reference to your own userId`)); }); - it('throws error when userPrincipalName is not equal to current signed in userPrincipalName in Cli when passing both the options currentPassword and newPassword', async () => { + it('throws error when userName is not equal to current signed in userName in Cli when passing both the options currentPassword and newPassword', async () => { sinon.stub(accessToken, 'getUserNameFromAccessToken').returns('john@contoso.com'); - await assert.rejects(command.action(logger, { options: { verbose: true, userPrincipalName: userPrincipalName, newPassword: newPassword, currentPassword: currentPassword } } as any), - new CommandError(`You can only change your own password. Please use --userPrincipalName @meUserName to reference to your own user principal name`)); + await assert.rejects(command.action(logger, { options: { verbose: true, userName: userName, newPassword: newPassword, currentPassword: currentPassword } } as any), + new CommandError(`You can only change your own password. Please use --userName @meUserName to reference to your own user principal name`)); }); it('correctly handles user or property not found', async () => { @@ -230,7 +230,7 @@ describe(commands.USER_SET, () => { } }); - await assert.rejects(command.action(logger, { options: { verbose: true, objectId: objectId, NonExistingProperty: 'Value' } } as any), + await assert.rejects(command.action(logger, { options: { verbose: true, id: id, NonExistingProperty: 'Value' } } as any), new CommandError(`Resource '1caf7dcd-7e83-4c3a-94f7-932a1299c844' does not exist or one of its queried reference-property objects are not present.`)); }); @@ -245,7 +245,7 @@ describe(commands.USER_SET, () => { await command.action(logger, { options: { verbose: true, - objectId: objectId, + id: id, Department: 'Sales & Marketing', companyName: 'Contoso', displayName: displayName, @@ -263,7 +263,7 @@ describe(commands.USER_SET, () => { it('correctly updates user with an empty value', async () => { const patchStub = sinon.stub(request, 'patch').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${objectId}`) { + if (opts.url === `https://graph.microsoft.com/v1.0/users/${id}`) { return; } @@ -272,7 +272,7 @@ describe(commands.USER_SET, () => { await command.action(logger, { options: { - objectId: objectId, + id: id, companyName: '' } } as any); @@ -280,9 +280,9 @@ describe(commands.USER_SET, () => { assert.strictEqual(patchStub.lastCall.args[0].data.companyName, null); }); - it('correctly resets password for a specified user by objectId', async () => { + it('correctly resets password for a specified user by id', async () => { sinon.stub(request, 'patch').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${objectId}` + if (opts.url === `https://graph.microsoft.com/v1.0/users/${id}` && opts.data.passwordProfile !== undefined && opts.data.passwordProfile.password === newPassword && opts.data.passwordProfile.forceChangePasswordNextSignIn === true @@ -295,7 +295,7 @@ describe(commands.USER_SET, () => { await command.action(logger, { options: { verbose: true, - objectId: objectId, + id: id, resetPassword: true, newPassword: newPassword, forceChangePasswordNextSignIn: true, @@ -305,9 +305,9 @@ describe(commands.USER_SET, () => { assert(loggerLogSpy.notCalled); }); - it('correctly resets password for a specified user by userPrincipalName', async () => { + it('correctly resets password for a specified user by userName', async () => { sinon.stub(request, 'patch').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userPrincipalName)}` + if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName)}` && opts.data.passwordProfile !== undefined && opts.data.passwordProfile.password === newPassword && opts.data.passwordProfile.forceChangePasswordNextSignIn === false) { @@ -319,7 +319,7 @@ describe(commands.USER_SET, () => { await command.action(logger, { options: { verbose: true, - userPrincipalName: userPrincipalName, + userName: userName, resetPassword: true, newPassword: newPassword } @@ -327,10 +327,10 @@ describe(commands.USER_SET, () => { assert(loggerLogSpy.notCalled); }); - it('correctly changes password for current user retrieved by userPrincipalName', async () => { - sinon.stub(accessToken, 'getUserNameFromAccessToken').returns(userPrincipalName); + it('correctly changes password for current user retrieved by userName', async () => { + sinon.stub(accessToken, 'getUserNameFromAccessToken').returns(userName); sinon.stub(request, 'post').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userPrincipalName)}/changePassword` + if (opts.url === `https://graph.microsoft.com/v1.0/users/${formatting.encodeQueryParameter(userName)}/changePassword` && opts.data !== undefined && opts.data.currentPassword === currentPassword && opts.data.newPassword === newPassword) { @@ -342,7 +342,7 @@ describe(commands.USER_SET, () => { await command.action(logger, { options: { verbose: true, - userPrincipalName: userPrincipalName, + userName: userName, currentPassword: currentPassword, newPassword: newPassword } @@ -350,10 +350,10 @@ describe(commands.USER_SET, () => { assert(loggerLogSpy.notCalled); }); - it('correctly changes password for current user retrieved by objectId', async () => { - sinon.stub(accessToken, 'getUserIdFromAccessToken').returns(objectId); + it('correctly changes password for current user retrieved by id', async () => { + sinon.stub(accessToken, 'getUserIdFromAccessToken').returns(id); sinon.stub(request, 'post').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${objectId}/changePassword` + if (opts.url === `https://graph.microsoft.com/v1.0/users/${id}/changePassword` && opts.data !== undefined && opts.data.currentPassword === currentPassword && opts.data.newPassword === newPassword) { @@ -365,7 +365,7 @@ describe(commands.USER_SET, () => { await command.action(logger, { options: { verbose: true, - objectId: objectId, + id: id, currentPassword: currentPassword, newPassword: newPassword } @@ -384,7 +384,7 @@ describe(commands.USER_SET, () => { await command.action(logger, { options: { verbose: true, - userPrincipalName: userPrincipalName, + userName: userName, accountEnabled: true } } as any); @@ -393,14 +393,14 @@ describe(commands.USER_SET, () => { it('updates Azure AD user and set its manager by id', async () => { const putStub = sinon.stub(request, 'put').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${userPrincipalName}/manager/$ref`) { + if (opts.url === `https://graph.microsoft.com/v1.0/users/${userName}/manager/$ref`) { return; } throw 'Invalid request'; }); - await command.action(logger, { options: { userPrincipalName: userPrincipalName, managerUserId: managerUserId } }); + await command.action(logger, { options: { userName: userName, managerUserId: managerUserId } }); assert.deepEqual(putStub.lastCall.args[0].data, { '@odata.id': `https://graph.microsoft.com/v1.0/users/${managerUserId}` }); @@ -408,14 +408,14 @@ describe(commands.USER_SET, () => { it('updates Azure AD user and set its manager by user principal name', async () => { const putStub = sinon.stub(request, 'put').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${userPrincipalName}/manager/$ref`) { + if (opts.url === `https://graph.microsoft.com/v1.0/users/${userName}/manager/$ref`) { return; } throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, userPrincipalName: userPrincipalName, managerUserName: managerUserName } }); + await command.action(logger, { options: { verbose: true, userName: userName, managerUserName: managerUserName } }); assert.deepEqual(putStub.lastCall.args[0].data, { '@odata.id': `https://graph.microsoft.com/v1.0/users/${managerUserName}` }); @@ -423,14 +423,14 @@ describe(commands.USER_SET, () => { it('updates Azure AD user and removes manager', async () => { const deleteStub = sinon.stub(request, 'delete').callsFake(async (opts) => { - if (opts.url === `https://graph.microsoft.com/v1.0/users/${userPrincipalName}/manager/$ref`) { + if (opts.url === `https://graph.microsoft.com/v1.0/users/${userName}/manager/$ref`) { return; } throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, userPrincipalName: userPrincipalName, removeManager: true } }); + await command.action(logger, { options: { verbose: true, userName: userName, removeManager: true } }); assert(deleteStub.called); }); }); diff --git a/src/m365/aad/commands/user/user-set.ts b/src/m365/aad/commands/user/user-set.ts index 18251837946..65f85546603 100644 --- a/src/m365/aad/commands/user/user-set.ts +++ b/src/m365/aad/commands/user/user-set.ts @@ -13,8 +13,8 @@ interface CommandArgs { } export interface Options extends GlobalOptions { - objectId?: string; - userPrincipalName?: string; + id?: string; + userName?: string; accountEnabled?: boolean; resetPassword?: boolean; forceChangePasswordNextSignIn?: boolean; @@ -61,8 +61,8 @@ class AadUserSetCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - objectId: typeof args.options.objectId !== 'undefined', - userPrincipalName: typeof args.options.userPrincipalName !== 'undefined', + id: typeof args.options.id !== 'undefined', + userName: typeof args.options.userName !== 'undefined', accountEnabled: !!args.options.accountEnabled, resetPassword: !!args.options.resetPassword, forceChangePasswordNextSignIn: !!args.options.forceChangePasswordNextSignIn, @@ -88,10 +88,10 @@ class AadUserSetCommand extends GraphCommand { #initOptions(): void { this.options.unshift( { - option: '-i, --objectId [objectId]' + option: '-i, --id [id]' }, { - option: '-n, --userPrincipalName [userPrincipalName]' + option: '-n, --userName [userName]' }, { option: '--accountEnabled [accountEnabled]', @@ -158,13 +158,13 @@ class AadUserSetCommand extends GraphCommand { #initValidators(): void { this.validators.push( async (args: CommandArgs) => { - if (args.options.objectId && - !validation.isValidGuid(args.options.objectId)) { - return `${args.options.objectId} is not a valid GUID`; + if (args.options.id && + !validation.isValidGuid(args.options.id)) { + return `${args.options.id} is not a valid GUID`; } - if (args.options.userPrincipalName && !validation.isValidUserPrincipalName(args.options.userPrincipalName)) { - return `${args.options.userPrincipalName} is not a valid userPrincipalName`; + if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) { + return `${args.options.userName} is not a valid userName`; } if (!args.options.resetPassword && ((args.options.currentPassword && !args.options.newPassword) || (args.options.newPassword && !args.options.currentPassword))) { @@ -234,7 +234,7 @@ class AadUserSetCommand extends GraphCommand { #initOptionSets(): void { this.optionSets.push( { - options: ['objectId', 'userPrincipalName'] + options: ['id', 'userName'] }, { options: ['managerUserId', 'managerUserName', 'removeManager'], @@ -246,24 +246,24 @@ class AadUserSetCommand extends GraphCommand { public async commandAction(logger: Logger, args: CommandArgs): Promise { try { if (args.options.currentPassword) { - if (args.options.objectId && args.options.objectId !== accessToken.getUserIdFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken)) { - throw `You can only change your own password. Please use --objectId @meId to reference to your own userId`; + if (args.options.id && args.options.id !== accessToken.getUserIdFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken)) { + throw `You can only change your own password. Please use --id @meId to reference to your own userId`; } - else if (args.options.userPrincipalName && args.options.userPrincipalName.toLowerCase() !== accessToken.getUserNameFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken).toLowerCase()) { - throw 'You can only change your own password. Please use --userPrincipalName @meUserName to reference to your own user principal name'; + else if (args.options.userName && args.options.userName.toLowerCase() !== accessToken.getUserNameFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken).toLowerCase()) { + throw 'You can only change your own password. Please use --userName @meUserName to reference to your own user principal name'; } } if (this.verbose) { - logger.logToStderr(`Updating user ${args.options.userPrincipalName || args.options.objectId}`); + logger.logToStderr(`Updating user ${args.options.userName || args.options.id}`); } - const requestUrl = `${this.resource}/v1.0/users/${formatting.encodeQueryParameter(args.options.objectId ? args.options.objectId : args.options.userPrincipalName as string)}`; + const requestUrl = `${this.resource}/v1.0/users/${formatting.encodeQueryParameter(args.options.id ? args.options.id : args.options.userName as string)}`; const manifest: any = this.mapRequestBody(args.options); if (Object.keys(manifest).some(k => manifest[k] !== undefined)) { if (this.verbose) { - logger.logToStderr(`Setting the updated properties for user ${args.options.userPrincipalName || args.options.objectId}`); + logger.logToStderr(`Setting the updated properties for user ${args.options.userName || args.options.id}`); } const requestOptions: CliRequestOptions = { url: requestUrl, @@ -291,7 +291,7 @@ class AadUserSetCommand extends GraphCommand { if (this.verbose) { logger.logToStderr('Removing the manager'); } - const user = args.options.objectId || args.options.userPrincipalName; + const user = args.options.id || args.options.userName; await this.removeManager(user!); } } @@ -336,7 +336,7 @@ class AadUserSetCommand extends GraphCommand { private async changePassword(requestUrl: string, options: Options, logger: Logger): Promise { if (this.verbose) { - logger.logToStderr(`Changing password for user ${options.userPrincipalName || options.objectId}`); + logger.logToStderr(`Changing password for user ${options.userName || options.id}`); } const requestBody = { @@ -356,7 +356,7 @@ class AadUserSetCommand extends GraphCommand { private async updateManager(options: Options): Promise { const managerRequestOptions: CliRequestOptions = { - url: `${this.resource}/v1.0/users/${options.objectId || options.userPrincipalName}/manager/$ref`, + url: `${this.resource}/v1.0/users/${options.id || options.userName}/manager/$ref`, headers: { accept: 'application/json;odata.metadata=none' }, diff --git a/src/m365/pa/commands/app/app-consent-set.spec.ts b/src/m365/pa/commands/app/app-consent-set.spec.ts index 80f6fcc8bbc..7b9d3bd2b2d 100644 --- a/src/m365/pa/commands/app/app-consent-set.spec.ts +++ b/src/m365/pa/commands/app/app-consent-set.spec.ts @@ -15,7 +15,7 @@ const command: Command = require('./app-consent-set'); describe(commands.APP_CONSENT_SET, () => { //#region Mocked Responses - const environment = 'Default-4be50206-9576-4237-8b17-38d8aadfaa36'; + const environmentName = 'Default-4be50206-9576-4237-8b17-38d8aadfaa36'; const name = 'e0c89645-7f00-4877-a290-cbaf6e060da1'; //#endregion @@ -76,7 +76,7 @@ describe(commands.APP_CONSENT_SET, () => { it('fails validation if the name is not valid GUID', async () => { const actual = await command.validate({ options: { - environment: environment, + environmentName: environmentName, name: 'invalid', bypass: true } @@ -87,7 +87,7 @@ describe(commands.APP_CONSENT_SET, () => { it('passes validation when the name specified', async () => { const actual = await command.validate({ options: { - environment: environment, + environmentName: environmentName, name: name, bypass: true } @@ -98,7 +98,7 @@ describe(commands.APP_CONSENT_SET, () => { it('prompts before bypassing consent for the specified Microsoft Power App when confirm option not passed', async () => { await command.action(logger, { options: { - environment: environment, + environmentName: environmentName, name: name, bypass: true } @@ -119,7 +119,7 @@ describe(commands.APP_CONSENT_SET, () => { await command.action(logger, { options: { - environment: environment, + environmentName: environmentName, name: name, bypass: true } @@ -129,7 +129,7 @@ describe(commands.APP_CONSENT_SET, () => { it('bypasses consent for the specified Microsoft Power App when prompt confirmed (debug)', async () => { sinon.stub(request, 'post').callsFake(async (opts) => { - if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/scopes/admin/environments/${environment}/apps/${name}/setPowerAppConnectionDirectConsentBypass?api-version=2021-02-01`) { + if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/scopes/admin/environments/${environmentName}/apps/${name}/setPowerAppConnectionDirectConsentBypass?api-version=2021-02-01`) { return { statusCode: 204 }; } @@ -142,7 +142,7 @@ describe(commands.APP_CONSENT_SET, () => { await assert.doesNotReject(command.action(logger, { options: { debug: true, - environment: environment, + environmentName: environmentName, name: name, bypass: true } @@ -151,7 +151,7 @@ describe(commands.APP_CONSENT_SET, () => { it('bypasses consent for the specified Microsoft Power App without prompting when confirm specified', async () => { sinon.stub(request, 'post').callsFake(async (opts) => { - if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/scopes/admin/environments/${environment}/apps/${name}/setPowerAppConnectionDirectConsentBypass?api-version=2021-02-01`) { + if (opts.url === `https://api.powerapps.com/providers/Microsoft.PowerApps/scopes/admin/environments/${environmentName}/apps/${name}/setPowerAppConnectionDirectConsentBypass?api-version=2021-02-01`) { return { statusCode: 204 }; } @@ -160,7 +160,7 @@ describe(commands.APP_CONSENT_SET, () => { await assert.doesNotReject(command.action(logger, { options: { - environment: environment, + environmentName: environmentName, name: name, bypass: true, force: true @@ -179,7 +179,7 @@ describe(commands.APP_CONSENT_SET, () => { await assert.rejects(command.action(logger, { options: { - environment: environment, + environmentName: environmentName, name: name, bypass: true, force: true diff --git a/src/m365/pa/commands/app/app-consent-set.ts b/src/m365/pa/commands/app/app-consent-set.ts index 7cb610931eb..1d1c0d7afb0 100644 --- a/src/m365/pa/commands/app/app-consent-set.ts +++ b/src/m365/pa/commands/app/app-consent-set.ts @@ -11,7 +11,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string, + environmentName: string, name: string; bypass: boolean; force?: boolean; @@ -37,7 +37,7 @@ class PaAppConsentSetCommand extends PowerAppsCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-n, --name ' @@ -92,7 +92,7 @@ class PaAppConsentSetCommand extends PowerAppsCommand { private async consentPaApp(args: CommandArgs): Promise { const requestOptions: CliRequestOptions = { - url: `${this.resource}/providers/Microsoft.PowerApps/scopes/admin/environments/${args.options.environment}/apps/${args.options.name}/setPowerAppConnectionDirectConsentBypass?api-version=2021-02-01`, + url: `${this.resource}/providers/Microsoft.PowerApps/scopes/admin/environments/${args.options.environmentName}/apps/${args.options.name}/setPowerAppConnectionDirectConsentBypass?api-version=2021-02-01`, headers: { accept: 'application/json;odata.metadata=none' }, diff --git a/src/m365/pa/commands/app/app-export.spec.ts b/src/m365/pa/commands/app/app-export.spec.ts index 59bc0e172fc..d02352ba37f 100644 --- a/src/m365/pa/commands/app/app-export.spec.ts +++ b/src/m365/pa/commands/app/app-export.spec.ts @@ -26,7 +26,7 @@ describe(commands.APP_EXPORT, () => { const packageCreatedBy = 'John Doe'; const packageSourceEnvironment = "Contoso"; const path = 'c:/users/John/Documents'; - const environment = 'Default-cf409f12-a06f-426e-9955-20f5d7a31dd3'; + const environmentName = 'Default-cf409f12-a06f-426e-9955-20f5d7a31dd3'; const appId = '11403f1a-de85-4b7d-97c9-020429876cb8'; const listPackageResourcesResponse = { status: 'Succeeded', @@ -51,7 +51,7 @@ describe(commands.APP_EXPORT, () => { const exportPackageResponse = { headers: { - location: `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environment}/packagingOperations/10fc880b-b11d-4fac-b842-386c66b869eb?api-version=2016-11-01` + location: `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environmentName}/packagingOperations/10fc880b-b11d-4fac-b842-386c66b869eb?api-version=2016-11-01` }, data: { status: 'Running', @@ -79,9 +79,9 @@ describe(commands.APP_EXPORT, () => { }; const locationRunningResponse = { - id: `/providers/Microsoft.BusinessAppPlatform/environments/${environment}/packagingOperations/10fc880b-b11d-4fac-b842-386c66b869eb`, + id: `/providers/Microsoft.BusinessAppPlatform/environments/${environmentName}/packagingOperations/10fc880b-b11d-4fac-b842-386c66b869eb`, type: 'Microsoft.BusinessAppPlatform/environments/packagingOperations', - environmentName: environment, + environmentName: environmentName, name: '10fc880b-b11d-4fac-b842-386c66b869eb', properties: { status: 'Running', @@ -214,11 +214,11 @@ describe(commands.APP_EXPORT, () => { }); sinon.stub(request, 'post').callsFake(async (opts) => { - if (opts.url === `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environment}/listPackageResources?api-version=2016-11-01`) { + if (opts.url === `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environmentName}/listPackageResources?api-version=2016-11-01`) { return listPackageResourcesResponse; } - if (opts.url === `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environment}/exportPackage?api-version=2016-11-01`) { + if (opts.url === `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environmentName}/exportPackage?api-version=2016-11-01`) { return exportPackageResponse; } @@ -226,7 +226,7 @@ describe(commands.APP_EXPORT, () => { }); sinon.stub(fs, 'writeFileSync').returns(); - await assert.doesNotReject(command.action(logger, { options: { id: appId, environment: environment, packageDisplayName: packageDisplayName } })); + await assert.doesNotReject(command.action(logger, { options: { id: appId, environmentName: environmentName, packageDisplayName: packageDisplayName } })); }); it('exports the specified App (debug)', async () => { @@ -250,11 +250,11 @@ describe(commands.APP_EXPORT, () => { }); sinon.stub(request, 'post').callsFake(async (opts) => { - if (opts.url === `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environment}/listPackageResources?api-version=2016-11-01`) { + if (opts.url === `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environmentName}/listPackageResources?api-version=2016-11-01`) { return listPackageResourcesResponse; } - if (opts.url === `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environment}/exportPackage?api-version=2016-11-01`) { + if (opts.url === `https://api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/environments/${environmentName}/exportPackage?api-version=2016-11-01`) { return exportPackageResponse; } @@ -262,24 +262,24 @@ describe(commands.APP_EXPORT, () => { }); sinon.stub(fs, 'writeFileSync').returns(); - await command.action(logger, { options: { verbose: true, id: appId, environment: environment, packageDisplayName: packageDisplayName, packageDescription: packageDescription, packageCreatedBy: packageCreatedBy, packageSourceEnvironment: packageSourceEnvironment, path: path } }); + await command.action(logger, { options: { verbose: true, id: appId, environmentName: environmentName, packageDisplayName: packageDisplayName, packageDescription: packageDescription, packageCreatedBy: packageCreatedBy, packageSourceEnvironment: packageSourceEnvironment, path: path } }); assert(loggerLogToStderrSpy.calledWith(`File saved to path '${path}/${actualFilename}'`)); }); it('fails validation if the id is not a GUID', async () => { - const actual = await command.validate({ options: { id: 'foo', environment: environment, packageDisplayName: packageDisplayName } }, commandInfo); + const actual = await command.validate({ options: { id: 'foo', environmentName: environmentName, packageDisplayName: packageDisplayName } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if specified path doesn\'t exist', async () => { sinon.stub(fs, 'existsSync').returns(false); - const actual = await command.validate({ options: { id: appId, environment: environment, packageDisplayName: packageDisplayName, path: '/path/not/found.zip' } }, commandInfo); + const actual = await command.validate({ options: { id: appId, environmentName: environmentName, packageDisplayName: packageDisplayName, path: '/path/not/found.zip' } }, commandInfo); sinonUtil.restore(fs.existsSync); assert.notStrictEqual(actual, true); }); it('passes validation when the id, environment and packageDisplayName specified', async () => { - const actual = await command.validate({ options: { id: appId, environment: environment, packageDisplayName: packageDisplayName } }, commandInfo); + const actual = await command.validate({ options: { id: appId, environmentName: environmentName, packageDisplayName: packageDisplayName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -292,7 +292,7 @@ describe(commands.APP_EXPORT, () => { sinon.stub(request, 'post').rejects(error); - await assert.rejects(command.action(logger, { options: { id: appId, environment: environment, packageDisplayName: packageDisplayName } } as any), + await assert.rejects(command.action(logger, { options: { id: appId, environmentName: environmentName, packageDisplayName: packageDisplayName } } as any), new CommandError(error.error.message)); }); }); diff --git a/src/m365/pa/commands/app/app-export.ts b/src/m365/pa/commands/app/app-export.ts index 2e7e4b4830e..50299139115 100644 --- a/src/m365/pa/commands/app/app-export.ts +++ b/src/m365/pa/commands/app/app-export.ts @@ -15,7 +15,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - environment: string; + environmentName: string; packageDisplayName: string; packageDescription?: string; packageCreatedBy?: string; @@ -59,7 +59,7 @@ class PaAppExportCommand extends PowerPlatformCommand { option: '-i, --id ' }, { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-n, --packageDisplayName [packageDisplayName]' @@ -140,7 +140,7 @@ class PaAppExportCommand extends PowerPlatformCommand { } const requestOptions: CliRequestOptions = { - url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting.encodeQueryParameter(args.options.environment)}/listPackageResources?api-version=2016-11-01`, + url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/listPackageResources?api-version=2016-11-01`, headers: { accept: 'application/json' }, @@ -167,7 +167,7 @@ class PaAppExportCommand extends PowerPlatformCommand { const resources = await this.getPackageResources(args, logger); const requestOptions: CliRequestOptions = { - url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting.encodeQueryParameter(args.options.environment)}/exportPackage?api-version=2016-11-01`, + url: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/exportPackage?api-version=2016-11-01`, headers: { accept: 'application/json' }, diff --git a/src/m365/pa/commands/app/app-list.spec.ts b/src/m365/pa/commands/app/app-list.spec.ts index 0c30bc4dea3..9fcbd83e951 100644 --- a/src/m365/pa/commands/app/app-list.spec.ts +++ b/src/m365/pa/commands/app/app-list.spec.ts @@ -2458,7 +2458,7 @@ describe(commands.APP_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { asAdmin: true, environment: '4ce50206-9576-4237-8b17-38d8aadfaa35' } }); + await command.action(logger, { options: { asAdmin: true, environmentName: '4ce50206-9576-4237-8b17-38d8aadfaa35' } }); assert(loggerLogSpy.calledWith([ { "name": "4d4bb961-eef9-4258-8516-aa8d64e6b477", @@ -2940,7 +2940,7 @@ describe(commands.APP_LIST, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6' } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6' } } as any), new CommandError(`Access to the environment 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6' is denied.`)); }); @@ -3465,12 +3465,12 @@ describe(commands.APP_LIST, () => { }); it('fails validation if environment specified without admin', async () => { - const actual = await command.validate({ options: { environment: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6' } }, commandInfo); + const actual = await command.validate({ options: { environmentName: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6' } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation if asAdmin specified with environment', async () => { - const actual = await command.validate({ options: { asAdmin: true, environment: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6' } }, commandInfo); + const actual = await command.validate({ options: { asAdmin: true, environmentName: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6' } }, commandInfo); assert.strictEqual(actual, true); }); diff --git a/src/m365/pa/commands/app/app-list.ts b/src/m365/pa/commands/app/app-list.ts index 645ce4be8fc..c633f38dd91 100644 --- a/src/m365/pa/commands/app/app-list.ts +++ b/src/m365/pa/commands/app/app-list.ts @@ -10,7 +10,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment?: string; + environmentName?: string; asAdmin: boolean; } @@ -39,7 +39,7 @@ class PaAppListCommand extends PowerAppsCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { asAdmin: args.options.asAdmin === true, - environment: typeof args.options.environment !== 'undefined' + environmentName: typeof args.options.environmentName !== 'undefined' }); }); } @@ -47,7 +47,7 @@ class PaAppListCommand extends PowerAppsCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment [environment]' + option: '-e, --environmentName [environmentName]' }, { option: '--asAdmin' @@ -58,11 +58,11 @@ class PaAppListCommand extends PowerAppsCommand { #initValidators(): void { this.validators.push( async (args: CommandArgs) => { - if (args.options.asAdmin && !args.options.environment) { + if (args.options.asAdmin && !args.options.environmentName) { return 'When specifying the asAdmin option the environment option is required as well'; } - if (args.options.environment && !args.options.asAdmin) { + if (args.options.environmentName && !args.options.asAdmin) { return 'When specifying the environment option the asAdmin option is required as well'; } @@ -72,7 +72,7 @@ class PaAppListCommand extends PowerAppsCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - const url = `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.environment ? '/environments/' + formatting.encodeQueryParameter(args.options.environment) : ''}/apps?api-version=2017-08-01`; + const url = `${this.resource}/providers/Microsoft.PowerApps${args.options.asAdmin ? '/scopes/admin' : ''}${args.options.environmentName ? '/environments/' + formatting.encodeQueryParameter(args.options.environmentName) : ''}/apps?api-version=2017-08-01`; try { const apps = await odata.getAllItems<{ name: string; displayName: string; properties: { displayName: string } }>(url); diff --git a/src/m365/pp/commands/aibuildermodel/aibuildermodel-get.spec.ts b/src/m365/pp/commands/aibuildermodel/aibuildermodel-get.spec.ts index 8c87ebda687..f52fe3f8cfa 100644 --- a/src/m365/pp/commands/aibuildermodel/aibuildermodel-get.spec.ts +++ b/src/m365/pp/commands/aibuildermodel/aibuildermodel-get.spec.ts @@ -117,7 +117,7 @@ describe(commands.AIBUILDERMODEL_GET, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -125,12 +125,12 @@ describe(commands.AIBUILDERMODEL_GET, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -155,7 +155,7 @@ describe(commands.AIBUILDERMODEL_GET, () => { await assert.rejects(command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }), new CommandError(`Multiple AI builder models with name '${validName}' found: ${multipleAiBuilderModelsResponse.value.map(x => x.msdyn_aimodelid).join(',')}`)); @@ -176,7 +176,7 @@ describe(commands.AIBUILDERMODEL_GET, () => { await assert.rejects(command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }), new CommandError(`The specified AI builder model '${validName}' does not exist.`)); @@ -195,7 +195,7 @@ describe(commands.AIBUILDERMODEL_GET, () => { throw `Invalid request ${opts.url}`; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, name: validName } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, name: validName } }); assert(loggerLogSpy.calledWith(aiBuilderModelResponse.value[0])); }); @@ -212,7 +212,7 @@ describe(commands.AIBUILDERMODEL_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, id: validId } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, id: validId } }); assert(loggerLogSpy.calledWith(aiBuilderModelResponse.value[0])); }); @@ -236,7 +236,7 @@ describe(commands.AIBUILDERMODEL_GET, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment, name: validName } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment, name: validName } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); \ No newline at end of file diff --git a/src/m365/pp/commands/aibuildermodel/aibuildermodel-get.ts b/src/m365/pp/commands/aibuildermodel/aibuildermodel-get.ts index 94626e079e2..dcdc5790f96 100644 --- a/src/m365/pp/commands/aibuildermodel/aibuildermodel-get.ts +++ b/src/m365/pp/commands/aibuildermodel/aibuildermodel-get.ts @@ -11,7 +11,7 @@ interface CommandArgs { } export interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -52,7 +52,7 @@ class PpAiBuilderModelGetCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -90,7 +90,7 @@ class PpAiBuilderModelGetCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const res = await this.getAiBuilderModel(dynamicsApiUrl, args.options); logger.log(res); diff --git a/src/m365/pp/commands/aibuildermodel/aibuildermodel-list.spec.ts b/src/m365/pp/commands/aibuildermodel/aibuildermodel-list.spec.ts index ac4f3539d4a..a54e41564f1 100644 --- a/src/m365/pp/commands/aibuildermodel/aibuildermodel-list.spec.ts +++ b/src/m365/pp/commands/aibuildermodel/aibuildermodel-list.spec.ts @@ -128,7 +128,7 @@ describe(commands.AIBUILDERMODEL_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment } }); assert(loggerLogSpy.calledWith(modelsResponse.value)); }); @@ -153,7 +153,7 @@ describe(commands.AIBUILDERMODEL_LIST, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/aibuildermodel/aibuildermodel-list.ts b/src/m365/pp/commands/aibuildermodel/aibuildermodel-list.ts index 76f38fa39b6..7e9b13063fe 100644 --- a/src/m365/pp/commands/aibuildermodel/aibuildermodel-list.ts +++ b/src/m365/pp/commands/aibuildermodel/aibuildermodel-list.ts @@ -10,7 +10,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; asAdmin?: boolean; } @@ -45,7 +45,7 @@ class PpAiBuilderModelListCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '--asAdmin' @@ -59,7 +59,7 @@ class PpAiBuilderModelListCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const aimodels = await odata.getAllItems(`${dynamicsApiUrl}/api/data/v9.0/msdyn_aimodels?$filter=iscustomizable/Value eq true`); logger.log(aimodels); diff --git a/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.spec.ts b/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.spec.ts index b1ea44ac6b9..f475478decf 100644 --- a/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.spec.ts +++ b/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.spec.ts @@ -122,7 +122,7 @@ describe(commands.AIBUILDERMODEL_REMOVE, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -130,12 +130,12 @@ describe(commands.AIBUILDERMODEL_REMOVE, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -144,7 +144,7 @@ describe(commands.AIBUILDERMODEL_REMOVE, () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -165,7 +165,7 @@ describe(commands.AIBUILDERMODEL_REMOVE, () => { )); await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -200,7 +200,7 @@ describe(commands.AIBUILDERMODEL_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }); @@ -221,7 +221,7 @@ describe(commands.AIBUILDERMODEL_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } @@ -239,7 +239,7 @@ describe(commands.AIBUILDERMODEL_REMOVE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } diff --git a/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.ts b/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.ts index 83c459ef102..695e3fa84a9 100644 --- a/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.ts +++ b/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.ts @@ -15,7 +15,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -55,7 +55,7 @@ class PpAiBuilderModelRemoveCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -118,7 +118,7 @@ class PpAiBuilderModelRemoveCommand extends PowerPlatformCommand { } const options: PpAiBuilderModelGetCommandOptions = { - environment: args.options.environment, + environmentName: args.options.environmentName, name: args.options.name, output: 'json', debug: this.debug, @@ -132,7 +132,7 @@ class PpAiBuilderModelRemoveCommand extends PowerPlatformCommand { private async deleteAiBuilderModel(args: CommandArgs): Promise { try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const aiBuilderModelId = await this.getAiBuilderModelId(args); const requestOptions: CliRequestOptions = { diff --git a/src/m365/pp/commands/card/card-clone.spec.ts b/src/m365/pp/commands/card/card-clone.spec.ts index fe54243e4ff..42408e80c0b 100644 --- a/src/m365/pp/commands/card/card-clone.spec.ts +++ b/src/m365/pp/commands/card/card-clone.spec.ts @@ -81,7 +81,7 @@ describe(commands.CARD_CLONE, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID', newName: validName } @@ -90,12 +90,12 @@ describe(commands.CARD_CLONE, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId, newName: validNewName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId, newName: validNewName } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName, newName: validNewName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName, newName: validNewName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -127,7 +127,7 @@ describe(commands.CARD_CLONE, () => { await command.action(logger, { options: { debug: true, - environment: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', + environmentName: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', name: validName, newName: validNewName } @@ -153,7 +153,7 @@ describe(commands.CARD_CLONE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, newName: validNewName } @@ -168,7 +168,7 @@ describe(commands.CARD_CLONE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, name: validName, force: true } diff --git a/src/m365/pp/commands/card/card-clone.ts b/src/m365/pp/commands/card/card-clone.ts index 55c95db9b9a..7e9e768be96 100644 --- a/src/m365/pp/commands/card/card-clone.ts +++ b/src/m365/pp/commands/card/card-clone.ts @@ -15,7 +15,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; newName: string; id?: string; name?: string; @@ -54,7 +54,7 @@ class PpCardCloneCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '--newName ' @@ -104,7 +104,7 @@ class PpCardCloneCommand extends PowerPlatformCommand { } const options: PpCardGetCommandOptions = { - environment: args.options.environment, + environmentName: args.options.environmentName, name: args.options.name, output: 'json', debug: this.debug, @@ -118,7 +118,7 @@ class PpCardCloneCommand extends PowerPlatformCommand { private async cloneCard(args: CommandArgs): Promise { try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const cardId = await this.getCardId(args); const requestOptions: CliRequestOptions = { diff --git a/src/m365/pp/commands/card/card-get.spec.ts b/src/m365/pp/commands/card/card-get.spec.ts index 1b7d194a208..83dfa15d959 100644 --- a/src/m365/pp/commands/card/card-get.spec.ts +++ b/src/m365/pp/commands/card/card-get.spec.ts @@ -130,7 +130,7 @@ describe(commands.CARD_GET, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -138,12 +138,12 @@ describe(commands.CARD_GET, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -162,7 +162,7 @@ describe(commands.CARD_GET, () => { await assert.rejects(command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }), new CommandError(`The specified card '${validName}' does not exist.`)); @@ -189,7 +189,7 @@ describe(commands.CARD_GET, () => { await assert.rejects(command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }), new CommandError(`Multiple cards with name '${validName}' found.`)); @@ -208,7 +208,7 @@ describe(commands.CARD_GET, () => { throw `Invalid request ${opts.url}`; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, name: validName } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, name: validName } }); assert(loggerLogSpy.calledWith(cardResponse.value[0])); }); @@ -225,7 +225,7 @@ describe(commands.CARD_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, id: validId } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, id: validId } }); assert(loggerLogSpy.calledWith(cardResponse.value[0])); }); @@ -249,7 +249,7 @@ describe(commands.CARD_GET, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment, name: validName } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment, name: validName } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/card/card-get.ts b/src/m365/pp/commands/card/card-get.ts index a2b9bb08dcc..f343183ec7d 100644 --- a/src/m365/pp/commands/card/card-get.ts +++ b/src/m365/pp/commands/card/card-get.ts @@ -12,7 +12,7 @@ interface CommandArgs { } export interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -54,7 +54,7 @@ class PpCardGetCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -92,7 +92,7 @@ class PpCardGetCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const res = await this.getCard(dynamicsApiUrl, args.options); logger.log(res); diff --git a/src/m365/pp/commands/card/card-list.spec.ts b/src/m365/pp/commands/card/card-list.spec.ts index cbd59afdba6..0706837610f 100644 --- a/src/m365/pp/commands/card/card-list.spec.ts +++ b/src/m365/pp/commands/card/card-list.spec.ts @@ -142,7 +142,7 @@ describe(commands.CARD_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36' } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36' } }); assert(loggerLogSpy.calledWith(cardResponse.value)); }); @@ -168,7 +168,7 @@ describe(commands.CARD_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36', asAdmin: true } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', asAdmin: true } }); assert(loggerLogSpy.calledWith(cardResponse.value)); }); @@ -185,6 +185,6 @@ describe(commands.CARD_LIST, () => { throw `Resource '' does not exist or one of its queried reference-property objects are not present`; }); - await assert.rejects(command.action(logger, { options: { environment: '4be50206-9576-4237-8b17-38d8aadfaa36' } }), new CommandError("Resource '' does not exist or one of its queried reference-property objects are not present")); + await assert.rejects(command.action(logger, { options: { environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36' } }), new CommandError("Resource '' does not exist or one of its queried reference-property objects are not present")); }); }); diff --git a/src/m365/pp/commands/card/card-list.ts b/src/m365/pp/commands/card/card-list.ts index 3daadca8880..69ee4deebea 100644 --- a/src/m365/pp/commands/card/card-list.ts +++ b/src/m365/pp/commands/card/card-list.ts @@ -10,7 +10,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; asAdmin?: boolean; } @@ -45,7 +45,7 @@ class PpCardListCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '--asAdmin' @@ -59,7 +59,7 @@ class PpCardListCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const items = await odata.getAllItems(`${dynamicsApiUrl}/api/data/v9.1/cards?$expand=owninguser($select=azureactivedirectoryobjectid,fullname)`); logger.log(items); diff --git a/src/m365/pp/commands/card/card-remove.spec.ts b/src/m365/pp/commands/card/card-remove.spec.ts index 860f52e30cb..eec18adfc9c 100644 --- a/src/m365/pp/commands/card/card-remove.spec.ts +++ b/src/m365/pp/commands/card/card-remove.spec.ts @@ -84,7 +84,7 @@ describe(commands.CARD_REMOVE, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -92,12 +92,12 @@ describe(commands.CARD_REMOVE, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -106,7 +106,7 @@ describe(commands.CARD_REMOVE, () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -127,7 +127,7 @@ describe(commands.CARD_REMOVE, () => { )); await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -162,7 +162,7 @@ describe(commands.CARD_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', + environmentName: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', name: 'CLI 365 Card' } }); @@ -183,7 +183,7 @@ describe(commands.CARD_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } @@ -201,7 +201,7 @@ describe(commands.CARD_REMOVE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } diff --git a/src/m365/pp/commands/card/card-remove.ts b/src/m365/pp/commands/card/card-remove.ts index d3e20ed1bb4..3d9ffcb085f 100644 --- a/src/m365/pp/commands/card/card-remove.ts +++ b/src/m365/pp/commands/card/card-remove.ts @@ -15,7 +15,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -55,7 +55,7 @@ class PpCardRemoveCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -118,7 +118,7 @@ class PpCardRemoveCommand extends PowerPlatformCommand { } const options: PpCardGetCommandOptions = { - environment: args.options.environment, + environmentName: args.options.environmentName, name: args.options.name, output: 'json', debug: this.debug, @@ -132,7 +132,7 @@ class PpCardRemoveCommand extends PowerPlatformCommand { private async deleteCard(args: CommandArgs): Promise { try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const cardId = await this.getCardId(args); const requestOptions: CliRequestOptions = { diff --git a/src/m365/pp/commands/chatbot/chatbot-get.spec.ts b/src/m365/pp/commands/chatbot/chatbot-get.spec.ts index 87de63be039..48cb881cdeb 100644 --- a/src/m365/pp/commands/chatbot/chatbot-get.spec.ts +++ b/src/m365/pp/commands/chatbot/chatbot-get.spec.ts @@ -132,7 +132,7 @@ describe(commands.CHATBOT_GET, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -140,12 +140,12 @@ describe(commands.CHATBOT_GET, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -170,7 +170,7 @@ describe(commands.CHATBOT_GET, () => { await assert.rejects(command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }), new CommandError(`Multiple chatbots with name '${validName}' found: ${multipleBotsResponse.value.map(x => x.botid).join(',')}`)); @@ -191,7 +191,7 @@ describe(commands.CHATBOT_GET, () => { await assert.rejects(command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }), new CommandError(`The specified chatbot '${validName}' does not exist.`)); @@ -210,7 +210,7 @@ describe(commands.CHATBOT_GET, () => { throw `Invalid request ${opts.url}`; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, name: validName } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, name: validName } }); assert(loggerLogSpy.calledWith(botResponse.value[0])); }); @@ -227,7 +227,7 @@ describe(commands.CHATBOT_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, id: validId } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, id: validId } }); assert(loggerLogSpy.calledWith(botResponse.value[0])); }); @@ -248,7 +248,7 @@ describe(commands.CHATBOT_GET, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment, name: validName } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment, name: validName } } as any), new CommandError(`bot With Id = ${validId} Does Not Exist`)); }); }); diff --git a/src/m365/pp/commands/chatbot/chatbot-get.ts b/src/m365/pp/commands/chatbot/chatbot-get.ts index 43fdcae1b59..93cf035b6ba 100644 --- a/src/m365/pp/commands/chatbot/chatbot-get.ts +++ b/src/m365/pp/commands/chatbot/chatbot-get.ts @@ -12,7 +12,7 @@ interface CommandArgs { } export interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -54,7 +54,7 @@ class PpChatbotGetCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -92,7 +92,7 @@ class PpChatbotGetCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const res = await this.getChatbot(dynamicsApiUrl, args.options); logger.log(res); diff --git a/src/m365/pp/commands/chatbot/chatbot-list.spec.ts b/src/m365/pp/commands/chatbot/chatbot-list.spec.ts index 8bfe75ca127..17844982886 100644 --- a/src/m365/pp/commands/chatbot/chatbot-list.spec.ts +++ b/src/m365/pp/commands/chatbot/chatbot-list.spec.ts @@ -153,7 +153,7 @@ describe(commands.CHATBOT_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: validEnvironment } }); + await command.action(logger, { options: { debug: true, environmentName: validEnvironment } }); assert(loggerLogSpy.calledWith(chatbotResponse.value)); }); @@ -177,7 +177,7 @@ describe(commands.CHATBOT_LIST, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/chatbot/chatbot-list.ts b/src/m365/pp/commands/chatbot/chatbot-list.ts index 9364155121d..bd2b7ba3a30 100644 --- a/src/m365/pp/commands/chatbot/chatbot-list.ts +++ b/src/m365/pp/commands/chatbot/chatbot-list.ts @@ -10,7 +10,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; asAdmin?: boolean; } @@ -45,7 +45,7 @@ class PpChatbotListCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '--asAdmin' @@ -55,7 +55,7 @@ class PpChatbotListCommand extends PowerPlatformCommand { public async commandAction(logger: Logger, args: CommandArgs): Promise { if (this.verbose) { - logger.logToStderr(`Retrieving list of chatbots for environment '${args.options.environment}'.`); + logger.logToStderr(`Retrieving list of chatbots for environment '${args.options.environmentName}'.`); } const fetchXml: string = ` @@ -100,7 +100,7 @@ class PpChatbotListCommand extends PowerPlatformCommand { `; try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const items = await odata.getAllItems(`${dynamicsApiUrl}/api/data/v9.1/bots?fetchXml=${fetchXml}`); logger.log(items); diff --git a/src/m365/pp/commands/chatbot/chatbot-remove.spec.ts b/src/m365/pp/commands/chatbot/chatbot-remove.spec.ts index a0355a0416c..02595b497e4 100644 --- a/src/m365/pp/commands/chatbot/chatbot-remove.spec.ts +++ b/src/m365/pp/commands/chatbot/chatbot-remove.spec.ts @@ -84,7 +84,7 @@ describe(commands.CHATBOT_REMOVE, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -92,19 +92,19 @@ describe(commands.CHATBOT_REMOVE, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); it('prompts before removing the specified chatbot owned by the currently signed-in user when confirm option not passed', async () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -122,7 +122,7 @@ describe(commands.CHATBOT_REMOVE, () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -157,7 +157,7 @@ describe(commands.CHATBOT_REMOVE, () => { await command.action(logger, { options: { verbose: true, - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }); @@ -178,7 +178,7 @@ describe(commands.CHATBOT_REMOVE, () => { await command.action(logger, { options: { verbose: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } @@ -196,7 +196,7 @@ describe(commands.CHATBOT_REMOVE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } diff --git a/src/m365/pp/commands/chatbot/chatbot-remove.ts b/src/m365/pp/commands/chatbot/chatbot-remove.ts index 1c1c02fff69..75a17fdce92 100644 --- a/src/m365/pp/commands/chatbot/chatbot-remove.ts +++ b/src/m365/pp/commands/chatbot/chatbot-remove.ts @@ -15,7 +15,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -55,7 +55,7 @@ class PpChatbotRemoveCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -118,7 +118,7 @@ class PpChatbotRemoveCommand extends PowerPlatformCommand { } const options: PpChatbotGetCommandOptions = { - environment: args.options.environment, + environmentName: args.options.environmentName, name: args.options.name, output: 'json', debug: this.debug, @@ -132,7 +132,7 @@ class PpChatbotRemoveCommand extends PowerPlatformCommand { private async deleteChatbot(args: CommandArgs): Promise { try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const botId = await this.getChatbotId(args); const requestOptions: CliRequestOptions = { diff --git a/src/m365/pp/commands/dataverse/dataverse-table-get.spec.ts b/src/m365/pp/commands/dataverse/dataverse-table-get.spec.ts index b12e715693e..89fd917d254 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-get.spec.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-get.spec.ts @@ -147,7 +147,7 @@ describe(commands.DATAVERSE_TABLE_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: validEnvironment, name: validName } }); + await command.action(logger, { options: { debug: true, environmentName: validEnvironment, name: validName } }); assert(loggerLogSpy.calledWith(tableResponse)); }); @@ -166,7 +166,7 @@ describe(commands.DATAVERSE_TABLE_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: validEnvironment, name: validName, asAdmin: true } }); + await command.action(logger, { options: { debug: true, environmentName: validEnvironment, name: validName, asAdmin: true } }); assert(loggerLogSpy.calledWith(tableResponse)); }); @@ -190,7 +190,7 @@ describe(commands.DATAVERSE_TABLE_GET, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment, name: validName } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment, name: validName } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/dataverse/dataverse-table-get.ts b/src/m365/pp/commands/dataverse/dataverse-table-get.ts index e36a60dbd25..d64ac127bd2 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-get.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-get.ts @@ -11,7 +11,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; name: string; asAdmin: boolean; } @@ -47,7 +47,7 @@ class PpDataverseTableGetCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-n, --name ' @@ -64,7 +64,7 @@ class PpDataverseTableGetCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const requestOptions: CliRequestOptions = { url: `${dynamicsApiUrl}/api/data/v9.0/EntityDefinitions(LogicalName='${args.options.name}')?$select=MetadataId,IsCustomEntity,IsManaged,SchemaName,IconVectorName,LogicalName,EntitySetName,IsActivity,DataProviderId,IsRenameable,IsCustomizable,CanCreateForms,CanCreateViews,CanCreateCharts,CanCreateAttributes,CanChangeTrackingBeEnabled,CanModifyAdditionalSettings,CanChangeHierarchicalRelationship,CanEnableSyncToExternalSearchIndex&api-version=9.1`, diff --git a/src/m365/pp/commands/dataverse/dataverse-table-list.spec.ts b/src/m365/pp/commands/dataverse/dataverse-table-list.spec.ts index 661a01ae655..4bc974e0d61 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-list.spec.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-list.spec.ts @@ -217,7 +217,7 @@ describe(commands.DATAVERSE_TABLE_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36' } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36' } }); assert(loggerLogSpy.calledWith(dataverseResponse.value)); }); @@ -242,7 +242,7 @@ describe(commands.DATAVERSE_TABLE_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36', asAdmin: true } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', asAdmin: true } }); assert(loggerLogSpy.calledWith(dataverseResponse.value)); }); @@ -269,7 +269,7 @@ describe(commands.DATAVERSE_TABLE_LIST, () => { }); try { - await command.action(logger, { options: { environment: '4be50206-9576-4237-8b17-38d8aadfaa36' } }); + await command.action(logger, { options: { environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36' } }); assert.fail('No error message thrown.'); } catch (ex) { diff --git a/src/m365/pp/commands/dataverse/dataverse-table-list.ts b/src/m365/pp/commands/dataverse/dataverse-table-list.ts index d15caa0b98f..48067f2de60 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-list.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-list.ts @@ -10,7 +10,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; asAdmin: boolean; } @@ -45,7 +45,7 @@ class PpDataverseTableListCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '--asAdmin' @@ -59,7 +59,7 @@ class PpDataverseTableListCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const endpoint = `${dynamicsApiUrl}/api/data/v9.0/EntityDefinitions?$select=MetadataId,IsCustomEntity,IsManaged,SchemaName,IconVectorName,LogicalName,EntitySetName,IsActivity,DataProviderId,IsRenameable,IsCustomizable,CanCreateForms,CanCreateViews,CanCreateCharts,CanCreateAttributes,CanChangeTrackingBeEnabled,CanModifyAdditionalSettings,CanChangeHierarchicalRelationship,CanEnableSyncToExternalSearchIndex&$filter=(IsIntersect eq false and IsLogicalEntity eq false and%0APrimaryNameAttribute ne null and PrimaryNameAttribute ne %27%27 and ObjectTypeCode gt 0 and%0AObjectTypeCode ne 4712 and ObjectTypeCode ne 4724 and ObjectTypeCode ne 9933 and ObjectTypeCode ne 9934 and%0AObjectTypeCode ne 9935 and ObjectTypeCode ne 9947 and ObjectTypeCode ne 9945 and ObjectTypeCode ne 9944 and%0AObjectTypeCode ne 9942 and ObjectTypeCode ne 9951 and ObjectTypeCode ne 2016 and ObjectTypeCode ne 9949 and%0AObjectTypeCode ne 9866 and ObjectTypeCode ne 9867 and ObjectTypeCode ne 9868) and (IsCustomizable/Value eq true or IsCustomEntity eq true or IsManaged eq false or IsMappable/Value eq true or IsRenameable/Value eq true)&api-version=9.1`; const res = await odata.getAllItems(endpoint); diff --git a/src/m365/pp/commands/dataverse/dataverse-table-remove.spec.ts b/src/m365/pp/commands/dataverse/dataverse-table-remove.spec.ts index b2a112a1f32..a3af2db3397 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-remove.spec.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-remove.spec.ts @@ -78,7 +78,7 @@ describe(commands.DATAVERSE_TABLE_REMOVE, () => { it('prompts before removing the specified table owned by the currently signed-in user when confirm option not passed', async () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }); @@ -96,7 +96,7 @@ describe(commands.DATAVERSE_TABLE_REMOVE, () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }); @@ -121,7 +121,7 @@ describe(commands.DATAVERSE_TABLE_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }); @@ -142,7 +142,7 @@ describe(commands.DATAVERSE_TABLE_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, name: validName, force: true } @@ -170,7 +170,7 @@ describe(commands.DATAVERSE_TABLE_REMOVE, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment, name: validName, force: true } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment, name: validName, force: true } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/dataverse/dataverse-table-remove.ts b/src/m365/pp/commands/dataverse/dataverse-table-remove.ts index 20ff6d0b4f4..fbacff08a05 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-remove.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-remove.ts @@ -11,7 +11,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; name: string; force?: true; asAdmin?: boolean; @@ -45,7 +45,7 @@ class PpDataverseTableRemoveCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-n, --name ' @@ -83,7 +83,7 @@ class PpDataverseTableRemoveCommand extends PowerPlatformCommand { private async removeDataverseTable(options: Options): Promise { try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(options.environment, options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(options.environmentName, options.asAdmin); const requestOptions: CliRequestOptions = { url: `${dynamicsApiUrl}/api/data/v9.0/EntityDefinitions(LogicalName='${options.name}')`, diff --git a/src/m365/pp/commands/dataverse/dataverse-table-row-list.spec.ts b/src/m365/pp/commands/dataverse/dataverse-table-row-list.spec.ts index 55802e3cc60..b67f9c78954 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-row-list.spec.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-row-list.spec.ts @@ -101,12 +101,12 @@ describe(commands.DATAVERSE_TABLE_ROW_LIST, () => { }); it('passes validation if required options specified (entitySetName)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, entitySetName: validEntitySetName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, entitySetName: validEntitySetName } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, tableName: validTableName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, tableName: validTableName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -123,7 +123,7 @@ describe(commands.DATAVERSE_TABLE_ROW_LIST, () => { throw `Invalid request ${opts.url}`; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, entitySetName: validEntitySetName } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, entitySetName: validEntitySetName } }); assert(loggerLogSpy.calledWith(rowsResponse.value)); }); @@ -146,7 +146,7 @@ describe(commands.DATAVERSE_TABLE_ROW_LIST, () => { throw `Invalid request ${opts.url}`; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, tableName: validTableName } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, tableName: validTableName } }); assert(loggerLogSpy.calledWith(rowsResponse.value)); }); @@ -170,7 +170,7 @@ describe(commands.DATAVERSE_TABLE_ROW_LIST, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment, entitySetName: validEntitySetName } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment, entitySetName: validEntitySetName } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/dataverse/dataverse-table-row-list.ts b/src/m365/pp/commands/dataverse/dataverse-table-row-list.ts index 7992ba9efdf..08ec25ce0a9 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-row-list.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-row-list.ts @@ -11,7 +11,7 @@ interface CommandArgs { } export interface Options extends GlobalOptions { - environment: string; + environmentName: string; entitySetName?: string; tableName?: string; asAdmin?: boolean; @@ -48,7 +48,7 @@ class PpDataverseTableRowListCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '--entitySetName [entitySetName]' @@ -74,7 +74,7 @@ class PpDataverseTableRowListCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const entitySetName = await this.getEntitySetName(dynamicsApiUrl, args); if (this.verbose) { diff --git a/src/m365/pp/commands/dataverse/dataverse-table-row-remove.spec.ts b/src/m365/pp/commands/dataverse/dataverse-table-row-remove.spec.ts index 626abbc69cb..dcc1ba8a961 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-row-remove.spec.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-row-remove.spec.ts @@ -88,7 +88,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID', tableName: validTableName } @@ -97,12 +97,12 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { }); it('passes validation if required options specified (tableName)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, tableName: validTableName, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, tableName: validTableName, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (entitySetName)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, entitySetName: validEntitySetName, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, entitySetName: validEntitySetName, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); @@ -111,7 +111,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -132,7 +132,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { )); await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -157,7 +157,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, entitySetName: validEntitySetName } @@ -189,7 +189,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, tableName: validTableName, force: true @@ -208,7 +208,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true, entitySetName: validEntitySetName @@ -230,7 +230,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, entitySetName: validEntitySetName, force: true diff --git a/src/m365/pp/commands/dataverse/dataverse-table-row-remove.ts b/src/m365/pp/commands/dataverse/dataverse-table-row-remove.ts index c8d72307b84..2f1d73d430d 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-row-remove.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-row-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; id: string; entitySetName?: string; tableName?: string; @@ -53,7 +53,7 @@ class PpDataverseTableRowRemoveCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id ' @@ -115,7 +115,7 @@ class PpDataverseTableRowRemoveCommand extends PowerPlatformCommand { private async deleteTableRow(logger: Logger, args: CommandArgs): Promise { try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const entitySetName = await this.getEntitySetName(dynamicsApiUrl, args); if (this.verbose) { diff --git a/src/m365/pp/commands/solution/solution-get.spec.ts b/src/m365/pp/commands/solution/solution-get.spec.ts index 089d66ebe7d..570f7efc1e9 100644 --- a/src/m365/pp/commands/solution/solution-get.spec.ts +++ b/src/m365/pp/commands/solution/solution-get.spec.ts @@ -111,7 +111,7 @@ describe(commands.SOLUTION_GET, () => { await assert.rejects(command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }), new CommandError(`The specified solution '${validName}' does not exist.`)); @@ -120,7 +120,7 @@ describe(commands.SOLUTION_GET, () => { it('fails validation if the id is not a valid guid', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -128,12 +128,12 @@ describe(commands.SOLUTION_GET, () => { }); it('passes validation if required options specified', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -150,7 +150,7 @@ describe(commands.SOLUTION_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36', name: 'Default' } }); + await command.action(logger, { options: { verbose: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', name: 'Default' } }); assert(loggerLogSpy.calledWith(solutionResponse.value[0])); }); @@ -167,7 +167,7 @@ describe(commands.SOLUTION_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36', name: 'Default', output: 'text' } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', name: 'Default', output: 'text' } }); assert(loggerLogSpy.calledWith(solutionResponseText)); }); @@ -184,7 +184,7 @@ describe(commands.SOLUTION_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36', id: 'ee62fd63-e49e-4c09-80de-8fae1b9a427e' } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', id: 'ee62fd63-e49e-4c09-80de-8fae1b9a427e' } }); assert(loggerLogSpy.calledWith(solutionResponse.value[0])); }); @@ -201,7 +201,7 @@ describe(commands.SOLUTION_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36', id: 'ee62fd63-e49e-4c09-80de-8fae1b9a427e', output: 'text' } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', id: 'ee62fd63-e49e-4c09-80de-8fae1b9a427e', output: 'text' } }); assert(loggerLogSpy.calledWith(solutionResponseText)); }); @@ -226,7 +226,7 @@ describe(commands.SOLUTION_GET, () => { }); - await assert.rejects(command.action(logger, { options: { environment: '4be50206-9576-4237-8b17-38d8aadfaa36', name: 'Default' } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', name: 'Default' } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/solution/solution-get.ts b/src/m365/pp/commands/solution/solution-get.ts index cb34e82f50c..679946c76f0 100644 --- a/src/m365/pp/commands/solution/solution-get.ts +++ b/src/m365/pp/commands/solution/solution-get.ts @@ -13,7 +13,7 @@ interface CommandArgs { } export interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -54,7 +54,7 @@ class PpSolutionGetCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -92,7 +92,7 @@ class PpSolutionGetCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const res = await this.getSolution(dynamicsApiUrl, args.options); if (!args.options.output || !Cli.shouldTrimOutput(args.options.output)) { diff --git a/src/m365/pp/commands/solution/solution-list.spec.ts b/src/m365/pp/commands/solution/solution-list.spec.ts index 15e39f61341..d6adb158614 100644 --- a/src/m365/pp/commands/solution/solution-list.spec.ts +++ b/src/m365/pp/commands/solution/solution-list.spec.ts @@ -145,7 +145,7 @@ describe(commands.SOLUTION_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36' } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36' } }); assert(loggerLogSpy.calledWith(solutionResponse.value)); }); @@ -170,7 +170,7 @@ describe(commands.SOLUTION_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36', output: 'json' } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', output: 'json' } }); assert(loggerLogSpy.calledWith(solutionResponse.value)); }); @@ -195,7 +195,7 @@ describe(commands.SOLUTION_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36', asAdmin: true, output: 'json' } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', asAdmin: true, output: 'json' } }); assert(loggerLogSpy.calledWith(solutionResponse.value)); }); @@ -221,7 +221,7 @@ describe(commands.SOLUTION_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: '4be50206-9576-4237-8b17-38d8aadfaa36', output: 'text' } }); + await command.action(logger, { options: { debug: true, environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36', output: 'text' } }); assert(loggerLogSpy.calledWith(solutionResponseText)); }); @@ -270,7 +270,7 @@ describe(commands.SOLUTION_LIST, () => { }); - await assert.rejects(command.action(logger, { options: { environment: '4be50206-9576-4237-8b17-38d8aadfaa36' } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: '4be50206-9576-4237-8b17-38d8aadfaa36' } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/solution/solution-list.ts b/src/m365/pp/commands/solution/solution-list.ts index c595aaa24ba..4039ef4f23f 100644 --- a/src/m365/pp/commands/solution/solution-list.ts +++ b/src/m365/pp/commands/solution/solution-list.ts @@ -12,7 +12,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; asAdmin: boolean; } @@ -47,7 +47,7 @@ class PpSolutionListCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '--asAdmin' @@ -61,7 +61,7 @@ class PpSolutionListCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const requestUrl = `${dynamicsApiUrl}/api/data/v9.0/solutions?$filter=isvisible eq true&$expand=publisherid($select=friendlyname)&$select=solutionid,uniquename,version,publisherid,installedon,solutionpackageversion,friendlyname,versionnumber&api-version=9.1`; const res = await odata.getAllItems(requestUrl); diff --git a/src/m365/pp/commands/solution/solution-publish.spec.ts b/src/m365/pp/commands/solution/solution-publish.spec.ts index 3e17d7fd6ba..a15f35431b0 100644 --- a/src/m365/pp/commands/solution/solution-publish.spec.ts +++ b/src/m365/pp/commands/solution/solution-publish.spec.ts @@ -99,7 +99,7 @@ describe(commands.SOLUTION_PUBLISH, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -107,12 +107,12 @@ describe(commands.SOLUTION_PUBLISH, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -162,7 +162,7 @@ describe(commands.SOLUTION_PUBLISH, () => { await assert.doesNotReject(command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, name: validName } })); @@ -214,7 +214,7 @@ describe(commands.SOLUTION_PUBLISH, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, name: validName, wait: true } @@ -232,7 +232,7 @@ describe(commands.SOLUTION_PUBLISH, () => { await assert.rejects(command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }), new CommandError(errorMessage)); diff --git a/src/m365/pp/commands/solution/solution-publish.ts b/src/m365/pp/commands/solution/solution-publish.ts index 0d0ea27d62a..9693a210d95 100644 --- a/src/m365/pp/commands/solution/solution-publish.ts +++ b/src/m365/pp/commands/solution/solution-publish.ts @@ -17,7 +17,7 @@ interface CommandArgs { } export interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -61,7 +61,7 @@ class PpSolutionPublishCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -98,7 +98,7 @@ class PpSolutionPublishCommand extends PowerPlatformCommand { public async commandAction(logger: Logger, args: any): Promise { try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const solutionId = await this.getSolutionId(args, logger); const solutionComponents = await this.getSolutionComponents(dynamicsApiUrl, solutionId, logger); const parameterXml = this.buildXmlRequestObject(solutionComponents, logger); @@ -158,7 +158,7 @@ class PpSolutionPublishCommand extends PowerPlatformCommand { } const options: PpSolutionGetCommandOptions = { - environment: args.options.environment, + environmentName: args.options.environmentName, name: args.options.name, output: 'json', debug: this.debug, diff --git a/src/m365/pp/commands/solution/solution-publisher-add.spec.ts b/src/m365/pp/commands/solution/solution-publisher-add.spec.ts index bd57557d976..267b3d9e318 100644 --- a/src/m365/pp/commands/solution/solution-publisher-add.spec.ts +++ b/src/m365/pp/commands/solution/solution-publisher-add.spec.ts @@ -75,7 +75,7 @@ describe(commands.SOLUTION_PUBLISHER_ADD, () => { it('fails validation if choiceValuePrefix is not a number', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName, displayName: validDisplayName, prefix: validPrefix, @@ -88,7 +88,7 @@ describe(commands.SOLUTION_PUBLISHER_ADD, () => { it('fails validation if choiceValuePrefix is more than the upper bound', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName, displayName: validDisplayName, prefix: validPrefix, @@ -101,7 +101,7 @@ describe(commands.SOLUTION_PUBLISHER_ADD, () => { it('fails validation if choiceValuePrefix is less than the lower bound', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName, displayName: validDisplayName, prefix: validPrefix, @@ -114,7 +114,7 @@ describe(commands.SOLUTION_PUBLISHER_ADD, () => { it('fails validation if name is not a valid value', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, name: '9_PublisherName', displayName: validDisplayName, prefix: validPrefix, @@ -127,7 +127,7 @@ describe(commands.SOLUTION_PUBLISHER_ADD, () => { it('fails validation if prefix is not a valid value', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName, displayName: validDisplayName, prefix: 'mscrmfoo', @@ -138,7 +138,7 @@ describe(commands.SOLUTION_PUBLISHER_ADD, () => { }); it('passes validation if required options specified', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName, displayName: validDisplayName, prefix: validPrefix, choiceValuePrefix: validChoiceValuePrefix } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName, displayName: validDisplayName, prefix: validPrefix, choiceValuePrefix: validChoiceValuePrefix } }, commandInfo); assert.strictEqual(actual, true); }); @@ -155,7 +155,7 @@ describe(commands.SOLUTION_PUBLISHER_ADD, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, name: validName, displayName: validDisplayName, prefix: validPrefix, choiceValuePrefix: validChoiceValuePrefix } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, name: validName, displayName: validDisplayName, prefix: validPrefix, choiceValuePrefix: validChoiceValuePrefix } }); }); it('correctly handles API OData error', async () => { @@ -178,7 +178,7 @@ describe(commands.SOLUTION_PUBLISHER_ADD, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment, name: validName, displayName: validDisplayName, prefix: validPrefix, choiceValuePrefix: validChoiceValuePrefix } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment, name: validName, displayName: validDisplayName, prefix: validPrefix, choiceValuePrefix: validChoiceValuePrefix } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/solution/solution-publisher-add.ts b/src/m365/pp/commands/solution/solution-publisher-add.ts index a3090a8ca78..7adaee3796b 100644 --- a/src/m365/pp/commands/solution/solution-publisher-add.ts +++ b/src/m365/pp/commands/solution/solution-publisher-add.ts @@ -10,7 +10,7 @@ interface CommandArgs { } export interface Options extends GlobalOptions { - environment: string; + environmentName: string; name: string; displayName: string; prefix: string; @@ -46,7 +46,7 @@ class PpSolutionPublisherAddCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-n, --name ' @@ -93,7 +93,7 @@ class PpSolutionPublisherAddCommand extends PowerPlatformCommand { logger.logToStderr(`Adding new publisher '${args.options.name}'...`); } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const requestOptions: CliRequestOptions = { url: `${dynamicsApiUrl}/api/data/v9.0/publishers`, diff --git a/src/m365/pp/commands/solution/solution-publisher-get.spec.ts b/src/m365/pp/commands/solution/solution-publisher-get.spec.ts index c90f1bd8695..2b3b50d57bd 100644 --- a/src/m365/pp/commands/solution/solution-publisher-get.spec.ts +++ b/src/m365/pp/commands/solution/solution-publisher-get.spec.ts @@ -102,7 +102,7 @@ describe(commands.SOLUTION_PUBLISHER_GET, () => { await assert.rejects(command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }), new CommandError(`The specified publisher '${validName}' does not exist.`)); @@ -111,7 +111,7 @@ describe(commands.SOLUTION_PUBLISHER_GET, () => { it('fails validation if the id is not a valid guid', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -119,12 +119,12 @@ describe(commands.SOLUTION_PUBLISHER_GET, () => { }); it('passes validation if required options specified', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -141,7 +141,7 @@ describe(commands.SOLUTION_PUBLISHER_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environment: validEnvironment, name: validName } }); + await command.action(logger, { options: { verbose: true, environmentName: validEnvironment, name: validName } }); assert(loggerLogSpy.calledWith(publisherResponse.value[0])); }); @@ -158,7 +158,7 @@ describe(commands.SOLUTION_PUBLISHER_GET, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: validEnvironment, id: validId } }); + await command.action(logger, { options: { debug: true, environmentName: validEnvironment, id: validId } }); assert(loggerLogSpy.calledWith(publisherResponse.value[0])); }); @@ -183,7 +183,7 @@ describe(commands.SOLUTION_PUBLISHER_GET, () => { }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment, name: validName } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment, name: validName } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/solution/solution-publisher-get.ts b/src/m365/pp/commands/solution/solution-publisher-get.ts index fb07022a30b..719838765ad 100644 --- a/src/m365/pp/commands/solution/solution-publisher-get.ts +++ b/src/m365/pp/commands/solution/solution-publisher-get.ts @@ -12,7 +12,7 @@ interface CommandArgs { } export interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -53,7 +53,7 @@ class PpSolutionPublisherGetCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -103,7 +103,7 @@ class PpSolutionPublisherGetCommand extends PowerPlatformCommand { }; try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); if (args.options.id) { requestOptions.url = `${dynamicsApiUrl}/api/data/v9.0/publishers(${args.options.id})?$select=publisherid,uniquename,friendlyname,versionnumber,isreadonly,description,customizationprefix,customizationoptionvalueprefix&api-version=9.1`; diff --git a/src/m365/pp/commands/solution/solution-publisher-list.spec.ts b/src/m365/pp/commands/solution/solution-publisher-list.spec.ts index 3f78f9ddba9..8d2a7ae2b18 100644 --- a/src/m365/pp/commands/solution/solution-publisher-list.spec.ts +++ b/src/m365/pp/commands/solution/solution-publisher-list.spec.ts @@ -104,7 +104,7 @@ describe(commands.SOLUTION_PUBLISHER_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: validEnvironment } }); + await command.action(logger, { options: { debug: true, environmentName: validEnvironment } }); assert(loggerLogSpy.calledWith(publisherResponse.value)); }); @@ -121,7 +121,7 @@ describe(commands.SOLUTION_PUBLISHER_LIST, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, environment: validEnvironment, includeMicrosoftPublishers: true } }); + await command.action(logger, { options: { debug: true, environmentName: validEnvironment, includeMicrosoftPublishers: true } }); assert(loggerLogSpy.calledWith(publisherResponse.value)); }); @@ -146,7 +146,7 @@ describe(commands.SOLUTION_PUBLISHER_LIST, () => { }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: validEnvironment } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); }); diff --git a/src/m365/pp/commands/solution/solution-publisher-list.ts b/src/m365/pp/commands/solution/solution-publisher-list.ts index 589e6871d55..26d7d4ed9e3 100644 --- a/src/m365/pp/commands/solution/solution-publisher-list.ts +++ b/src/m365/pp/commands/solution/solution-publisher-list.ts @@ -11,7 +11,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; includeMicrosoftPublishers: boolean; asAdmin: boolean; } @@ -48,7 +48,7 @@ class PpSolutionPublisherListCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '--includeMicrosoftPublishers' @@ -65,7 +65,7 @@ class PpSolutionPublisherListCommand extends PowerPlatformCommand { } try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const requestOptions: CliRequestOptions = { url: `${dynamicsApiUrl}/api/data/v9.0/publishers?$select=publisherid,uniquename,friendlyname,versionnumber,isreadonly,description,customizationprefix,customizationoptionvalueprefix${!args.options.includeMicrosoftPublishers ? `&$filter=publisherid ne 'd21aab70-79e7-11dd-8874-00188b01e34f'` : ''}&api-version=9.1`, diff --git a/src/m365/pp/commands/solution/solution-publisher-remove.spec.ts b/src/m365/pp/commands/solution/solution-publisher-remove.spec.ts index 6b4a7cfe3bd..b449ca3e974 100644 --- a/src/m365/pp/commands/solution/solution-publisher-remove.spec.ts +++ b/src/m365/pp/commands/solution/solution-publisher-remove.spec.ts @@ -85,7 +85,7 @@ describe(commands.SOLUTION_PUBLISHER_REMOVE, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -93,12 +93,12 @@ describe(commands.SOLUTION_PUBLISHER_REMOVE, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); @@ -107,7 +107,7 @@ describe(commands.SOLUTION_PUBLISHER_REMOVE, () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -158,7 +158,7 @@ describe(commands.SOLUTION_PUBLISHER_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }); @@ -179,7 +179,7 @@ describe(commands.SOLUTION_PUBLISHER_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } @@ -197,7 +197,7 @@ describe(commands.SOLUTION_PUBLISHER_REMOVE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } diff --git a/src/m365/pp/commands/solution/solution-publisher-remove.ts b/src/m365/pp/commands/solution/solution-publisher-remove.ts index 76c0c30492c..4cf29a3683b 100644 --- a/src/m365/pp/commands/solution/solution-publisher-remove.ts +++ b/src/m365/pp/commands/solution/solution-publisher-remove.ts @@ -15,7 +15,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -55,7 +55,7 @@ class PpSolutionPublisherRemoveCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -118,7 +118,7 @@ class PpSolutionPublisherRemoveCommand extends PowerPlatformCommand { } const options: PpSolutionPublisherGetCommandOptions = { - environment: args.options.environment, + environmentName: args.options.environmentName, name: args.options.name, output: 'json', debug: this.debug, @@ -132,7 +132,7 @@ class PpSolutionPublisherRemoveCommand extends PowerPlatformCommand { private async deletePublisher(args: CommandArgs): Promise { try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const publisherId = await this.getPublisherId(args); const requestOptions: CliRequestOptions = { diff --git a/src/m365/pp/commands/solution/solution-remove.spec.ts b/src/m365/pp/commands/solution/solution-remove.spec.ts index e91cda4b38e..913ed7c50c2 100644 --- a/src/m365/pp/commands/solution/solution-remove.spec.ts +++ b/src/m365/pp/commands/solution/solution-remove.spec.ts @@ -84,7 +84,7 @@ describe(commands.SOLUTION_REMOVE, () => { it('fails validation if id is not a valid guid.', async () => { const actual = await command.validate({ options: { - environment: validEnvironment, + environmentName: validEnvironment, id: 'Invalid GUID' } }, commandInfo); @@ -92,19 +92,19 @@ describe(commands.SOLUTION_REMOVE, () => { }); it('passes validation if required options specified (id)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, id: validId } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, id: validId } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation if required options specified (name)', async () => { - const actual = await command.validate({ options: { environment: validEnvironment, name: validName } }, commandInfo); + const actual = await command.validate({ options: { environmentName: validEnvironment, name: validName } }, commandInfo); assert.strictEqual(actual, true); }); it('prompts before removing the specified solution owned by the currently signed-in user when confirm option not passed', async () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -122,7 +122,7 @@ describe(commands.SOLUTION_REMOVE, () => { await command.action(logger, { options: { - environment: validEnvironment, + environmentName: validEnvironment, id: validId } }); @@ -169,7 +169,7 @@ describe(commands.SOLUTION_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, name: validName } }); @@ -190,7 +190,7 @@ describe(commands.SOLUTION_REMOVE, () => { await command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } @@ -208,7 +208,7 @@ describe(commands.SOLUTION_REMOVE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - environment: validEnvironment, + environmentName: validEnvironment, id: validId, force: true } diff --git a/src/m365/pp/commands/solution/solution-remove.ts b/src/m365/pp/commands/solution/solution-remove.ts index 3cf6f7273a9..0a6475bc588 100644 --- a/src/m365/pp/commands/solution/solution-remove.ts +++ b/src/m365/pp/commands/solution/solution-remove.ts @@ -15,7 +15,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - environment: string; + environmentName: string; id?: string; name?: string; asAdmin?: boolean; @@ -55,7 +55,7 @@ class PpSolutionRemoveCommand extends PowerPlatformCommand { #initOptions(): void { this.options.unshift( { - option: '-e, --environment ' + option: '-e, --environmentName ' }, { option: '-i, --id [id]' @@ -118,7 +118,7 @@ class PpSolutionRemoveCommand extends PowerPlatformCommand { } const options: PpSolutionGetCommandOptions = { - environment: args.options.environment, + environmentName: args.options.environmentName, name: args.options.name, output: 'json', debug: this.debug, @@ -132,7 +132,7 @@ class PpSolutionRemoveCommand extends PowerPlatformCommand { private async deleteSolution(args: CommandArgs): Promise { try { - const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environment, args.options.asAdmin); + const dynamicsApiUrl = await powerPlatform.getDynamicsInstanceApiUrl(args.options.environmentName, args.options.asAdmin); const solutionId = await this.getSolutionId(args); const requestOptions: CliRequestOptions = { diff --git a/src/m365/spo/commands/listitem/listitem-attachment-list.spec.ts b/src/m365/spo/commands/listitem/listitem-attachment-list.spec.ts index 99f0d9fb2f9..611dae8229b 100644 --- a/src/m365/spo/commands/listitem/listitem-attachment-list.spec.ts +++ b/src/m365/spo/commands/listitem/listitem-attachment-list.spec.ts @@ -40,7 +40,7 @@ describe(commands.LISTITEM_ATTACHMENT_LIST, () => { ] }; - const itemId = 147; + const listItemId = 147; const getFakes = async (opts: any) => { if ((opts.url as string).indexOf('/_api/web/lists') > -1) { @@ -112,37 +112,37 @@ describe(commands.LISTITEM_ATTACHMENT_LIST, () => { }); it('fails validation if listTitle and listId option not specified', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', itemId: itemId } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listItemId: listItemId } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if listTitle and listId are specified together', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listTitle: 'Demo List', listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', itemId: itemId } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listTitle: 'Demo List', listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', listItemId: listItemId } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if the webUrl option is not a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { webUrl: 'foo', listTitle: 'Demo List', itemId: itemId } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'foo', listTitle: 'Demo List', listItemId: listItemId } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation if the webUrl option is a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listTitle: 'Demo List', itemId: itemId } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listTitle: 'Demo List', listItemId: listItemId } }, commandInfo); assert(actual); }); it('fails validation if the listId option is not a valid GUID', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listId: 'foo', itemId: itemId } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listId: 'foo', listItemId: listItemId } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation if the listId option is a valid GUID', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', itemId: itemId } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', listItemId: listItemId } }, commandInfo); assert(actual); }); - it('fails validation if the specified itemId is not a number', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listTitle: 'Demo List', itemId: 'a' } }, commandInfo); + it('fails validation if the specified listItemId is not a number', async () => { + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', listTitle: 'Demo List', listItemId: 'a' } }, commandInfo); assert.notStrictEqual(actual, true); }); @@ -157,7 +157,7 @@ describe(commands.LISTITEM_ATTACHMENT_LIST, () => { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/project-x', listId: '0cd891ef-afce-4e55-b836-fce03286cccf', - itemId: itemId + listItemId: listItemId }; await command.action(logger, { options: options } as any); @@ -171,7 +171,7 @@ describe(commands.LISTITEM_ATTACHMENT_LIST, () => { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/project-x', listTitle: 'Demo List', - itemId: itemId + listItemId: listItemId }; await command.action(logger, { options: options } as any); @@ -185,7 +185,7 @@ describe(commands.LISTITEM_ATTACHMENT_LIST, () => { verbose: true, webUrl: webUrl, listUrl: listUrl, - itemId: itemId + listItemId: listItemId }; await command.action(logger, { options: options } as any); @@ -198,7 +198,7 @@ describe(commands.LISTITEM_ATTACHMENT_LIST, () => { const options: any = { webUrl: 'https://contoso.sharepoint.com/sites/project-x', listId: '0cd891ef-afce-4e55-b836-fce03286cccf', - itemId: itemId, + listItemId: listItemId, output: "json" }; @@ -214,7 +214,7 @@ describe(commands.LISTITEM_ATTACHMENT_LIST, () => { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/project-x', listId: '0cd891ef-afce-4e55-b836-fce03286cccf', - itemId: itemId + listItemId: listItemId }; await command.action(logger, { options: options }); diff --git a/src/m365/spo/commands/listitem/listitem-attachment-list.ts b/src/m365/spo/commands/listitem/listitem-attachment-list.ts index 88bb25d403a..120c6a91d9e 100644 --- a/src/m365/spo/commands/listitem/listitem-attachment-list.ts +++ b/src/m365/spo/commands/listitem/listitem-attachment-list.ts @@ -12,7 +12,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - itemId: string; + listItemId: string; listId?: string; listTitle?: string; listUrl?: string; @@ -53,7 +53,7 @@ class SpoListItemAttachmentListCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '--itemId ' + option: '--listItemId ' }, { option: '--listId [listId]' @@ -79,8 +79,8 @@ class SpoListItemAttachmentListCommand extends SpoCommand { return `${args.options.listId} in option listId is not a valid GUID`; } - if (isNaN(parseInt(args.options.itemId))) { - return `${args.options.itemId} is not a number`; + if (isNaN(parseInt(args.options.listItemId))) { + return `${args.options.listItemId} is not a number`; } return true; @@ -111,7 +111,7 @@ class SpoListItemAttachmentListCommand extends SpoCommand { } const requestOptions: CliRequestOptions = { - url: `${requestUrl}/items(${args.options.itemId})?$select=AttachmentFiles&$expand=AttachmentFiles`, + url: `${requestUrl}/items(${args.options.listItemId})?$select=AttachmentFiles&$expand=AttachmentFiles`, method: 'GET', headers: { 'accept': 'application/json;odata=nometadata' diff --git a/src/m365/spo/commands/user/user-get.spec.ts b/src/m365/spo/commands/user/user-get.spec.ts index b9d0ff5e840..bce04ffaeaf 100644 --- a/src/m365/spo/commands/user/user-get.spec.ts +++ b/src/m365/spo/commands/user/user-get.spec.ts @@ -166,7 +166,7 @@ describe(commands.USER_GET, () => { })); }); - it('retrieves user by loginName with output option json', async () => { + it('retrieves user by userName with output option json', async () => { sinon.stub(request, 'get').callsFake(async (opts) => { if ((opts.url as string).indexOf('/_api/web/siteusers/GetByLoginName') > -1) { return { @@ -194,7 +194,7 @@ describe(commands.USER_GET, () => { output: 'json', debug: true, webUrl: 'https://contoso.sharepoint.com', - loginName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" + userName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } }); assert(loggerLogSpy.calledWith({ @@ -223,7 +223,7 @@ describe(commands.USER_GET, () => { await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com', - loginName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" + userName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } } as any), new CommandError('An error has occurred')); }); @@ -244,13 +244,13 @@ describe(commands.USER_GET, () => { assert.notStrictEqual(actual, true); }); - it('fails validation if id or email or loginName options are not passed', async () => { + it('fails validation if id or email or userName options are not passed', async () => { const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com' } }, commandInfo); assert.notStrictEqual(actual, true); }); - it('fails validation if id, email and loginName options are passed (multiple options)', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', id: 1, email: "jonh.deo@mytenant.com", loginName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } }, commandInfo); + it('fails validation if id, email and userName options are passed (multiple options)', async () => { + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', id: 1, email: "jonh.deo@mytenant.com", userName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } }, commandInfo); assert.notStrictEqual(actual, true); }); @@ -259,13 +259,13 @@ describe(commands.USER_GET, () => { assert.notStrictEqual(actual, true); }); - it('fails validation if id and loginName options are passed (multiple options)', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', id: 1, loginName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } }, commandInfo); + it('fails validation if id and userName options are passed (multiple options)', async () => { + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', id: 1, userName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } }, commandInfo); assert.notStrictEqual(actual, true); }); - it('fails validation if email and loginName options are passed (multiple options)', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', email: "jonh.deo@mytenant.com", loginName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } }, commandInfo); + it('fails validation if email and userName options are passed (multiple options)', async () => { + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', email: "jonh.deo@mytenant.com", userName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } }, commandInfo); assert.notStrictEqual(actual, true); }); @@ -284,8 +284,8 @@ describe(commands.USER_GET, () => { assert.strictEqual(actual, true); }); - it('passes validation if the url is valid and loginName is passed', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', loginName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } }, commandInfo); + it('passes validation if the url is valid and userName is passed', async () => { + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', userName: "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com" } }, commandInfo); assert.strictEqual(actual, true); }); }); diff --git a/src/m365/spo/commands/user/user-get.ts b/src/m365/spo/commands/user/user-get.ts index d4aca6e889b..c47406ecd95 100644 --- a/src/m365/spo/commands/user/user-get.ts +++ b/src/m365/spo/commands/user/user-get.ts @@ -14,7 +14,7 @@ export interface Options extends GlobalOptions { webUrl: string; email?: string; id: string | number | undefined; - loginName?: string; + userName?: string; } class SpoUserGetCommand extends SpoCommand { @@ -40,7 +40,7 @@ class SpoUserGetCommand extends SpoCommand { Object.assign(this.telemetryProperties, { id: (!(!args.options.id)).toString(), email: (!(!args.options.email)).toString(), - loginName: (!(!args.options.loginName)).toString() + userName: (!(!args.options.userName)).toString() }); }); } @@ -57,7 +57,7 @@ class SpoUserGetCommand extends SpoCommand { option: '--email [email]' }, { - option: '--loginName [loginName]' + option: '--userName [userName]' } ); } @@ -76,7 +76,7 @@ class SpoUserGetCommand extends SpoCommand { } #initOptionSets(): void { - this.optionSets.push({ options: ['id', 'email', 'loginName'] }); + this.optionSets.push({ options: ['id', 'email', 'userName'] }); } public async commandAction(logger: Logger, args: CommandArgs): Promise { @@ -92,8 +92,8 @@ class SpoUserGetCommand extends SpoCommand { else if (args.options.email) { requestUrl = `${args.options.webUrl}/_api/web/siteusers/GetByEmail('${formatting.encodeQueryParameter(args.options.email as string)}')`; } - else if (args.options.loginName) { - requestUrl = `${args.options.webUrl}/_api/web/siteusers/GetByLoginName('${formatting.encodeQueryParameter(args.options.loginName as string)}')`; + else if (args.options.userName) { + requestUrl = `${args.options.webUrl}/_api/web/siteusers/GetByLoginName('${formatting.encodeQueryParameter(args.options.userName as string)}')`; } const requestOptions: any = {