diff --git a/docs/docs/cmd/aad/app/app-remove.mdx b/docs/docs/cmd/aad/app/app-remove.mdx index 7d3c7568210..fcaba22bffb 100644 --- a/docs/docs/cmd/aad/app/app-remove.mdx +++ b/docs/docs/cmd/aad/app/app-remove.mdx @@ -22,7 +22,7 @@ m365 aad app remove [options] `--name [name]` : Name of the Azure AD application registration to remove. Specify either `appId`, `objectId` or `name` but not multiple. -`--confirm` +`-f, --force` : Don't prompt for confirmation to remove the app. ``` @@ -51,7 +51,7 @@ m365 aad app remove --objectId d75be2e1-0204-4f95-857d-51a37cf40be8 Remove the Azure AD application registration by its name. Will NOT prompt for confirmation before deleting. ```sh -m365 aad app remove --name "My app" --confirm +m365 aad app remove --name "My app" --force ``` ## Response diff --git a/docs/docs/cmd/aad/app/app-role-remove.mdx b/docs/docs/cmd/aad/app/app-role-remove.mdx index 557731d142b..fe19d5c6642 100644 --- a/docs/docs/cmd/aad/app/app-role-remove.mdx +++ b/docs/docs/cmd/aad/app/app-role-remove.mdx @@ -31,7 +31,7 @@ m365 aad app role remove [options] `-c, --claim [claim]` : Claim value of the role to remove. Specify either `name`, `id` or `claim` -`--confirm` +`-f, --force` : Don't prompt for confirmation to remove the role. ``` @@ -70,7 +70,7 @@ m365 aad app role remove --appName "My app" --claim "Product.Get" Remove role from a Azure AD application registration using object ID and role id options. Will NOT prompt for confirmation before deleting the role. ```sh -m365 aad app role remove --appObjectId d75be2e1-0204-4f95-857d-51a37cf40be8 --id 15927ce6-1933-4b2f-b029-4dee3d53f4dd --confirm +m365 aad app role remove --appObjectId d75be2e1-0204-4f95-857d-51a37cf40be8 --id 15927ce6-1933-4b2f-b029-4dee3d53f4dd --force ``` ## Response diff --git a/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx b/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx index 243e146f126..da7b276f126 100644 --- a/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx +++ b/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx @@ -28,7 +28,7 @@ m365 aad approleassignment remove [options] `-s, --scope ` : Permissions known also as scopes and roles to be deleted from the application. If multiple permissions have to be deleted, they have to be comma-separated e.g. `Sites.Read.All`,`Sites.ReadWrite.All` -`--confirm` +`-f, --force` : Don't prompt for confirming removing the all role assignment ``` diff --git a/docs/docs/cmd/aad/groupsetting/groupsetting-remove.mdx b/docs/docs/cmd/aad/groupsetting/groupsetting-remove.mdx index fb43490d4b0..755517d7cf5 100644 --- a/docs/docs/cmd/aad/groupsetting/groupsetting-remove.mdx +++ b/docs/docs/cmd/aad/groupsetting/groupsetting-remove.mdx @@ -16,7 +16,7 @@ m365 aad groupsetting remove [options] `-i, --id ` : The ID of the group setting to remove -`--confirm` +`-f, --force` : Don't prompt for confirming removing the group setting ``` @@ -37,7 +37,7 @@ m365 aad groupsetting remove --id 28beab62-7540-4db1-a23f-29a6018a3848 Remove group setting with id _28beab62-7540-4db1-a23f-29a6018a3848_ without prompting for confirmation ```sh -m365 aad groupsetting remove --id 28beab62-7540-4db1-a23f-29a6018a3848 --confirm +m365 aad groupsetting remove --id 28beab62-7540-4db1-a23f-29a6018a3848 --force ``` ## Response diff --git a/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-clear.mdx b/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-clear.mdx index b174af8db96..cfeeaaa839f 100644 --- a/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-clear.mdx +++ b/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-clear.mdx @@ -13,7 +13,7 @@ m365 aad o365group recyclebinitem clear [options] ## Options ```md definition-list -`--confirm` +`-f, --force` : Don't prompt for confirmation to clear the recycle bin items. ``` @@ -30,7 +30,7 @@ m365 aad o365group recyclebinitem clear Removes all deleted Microsoft 365 Groups in the tenant. Will NOT prompt for confirmation before permanently removing groups. ```sh -m365 aad o365group recyclebinitem clear --confirm +m365 aad o365group recyclebinitem clear --force ``` ## Response diff --git a/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-remove.mdx b/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-remove.mdx index 374a24769da..b65760cf178 100644 --- a/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-remove.mdx +++ b/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-remove.mdx @@ -22,7 +22,7 @@ m365 aad o365group recyclebinitem remove [options] `-m, --mailNickname [mailNickname]` : Name of the group e-mail (part before the @). Specify either `id`, `displayName` or `mailNickname` but not multiple. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -45,7 +45,7 @@ m365 aad o365group recyclebinitem remove --displayName "My Group" Remove the Microsoft 365 Group with specific mail nickname without confirmation ```sh -m365 aad o365group recyclebinitem remove --mailNickname "Mygroup" --confirm +m365 aad o365group recyclebinitem remove --mailNickname "Mygroup" --force ``` ## Response diff --git a/docs/docs/cmd/aad/o365group/o365group-remove.mdx b/docs/docs/cmd/aad/o365group/o365group-remove.mdx index f098022d688..d40029b0bb5 100644 --- a/docs/docs/cmd/aad/o365group/o365group-remove.mdx +++ b/docs/docs/cmd/aad/o365group/o365group-remove.mdx @@ -16,7 +16,7 @@ m365 aad o365group remove [options] `-i, --id ` : The ID of the Microsoft 365 Group to remove -`--confirm` +`-f, --force` : Don't prompt for confirming removing the group `--skipRecycleBin` @@ -40,13 +40,13 @@ m365 aad o365group remove --id 28beab62-7540-4db1-a23f-29a6018a3848 Remove group with id _28beab62-7540-4db1-a23f-29a6018a3848_ without prompting for confirmation ```sh -m365 aad o365group remove --id 28beab62-7540-4db1-a23f-29a6018a3848 --confirm +m365 aad o365group remove --id 28beab62-7540-4db1-a23f-29a6018a3848 --force ``` Remove group with id _28beab62-7540-4db1-a23f-29a6018a3848_ without prompting for confirmation and without moving it to the Recycle Bin ```sh -m365 aad o365group remove --id 28beab62-7540-4db1-a23f-29a6018a3848 --confirm --skipRecycleBin +m365 aad o365group remove --id 28beab62-7540-4db1-a23f-29a6018a3848 --force --skipRecycleBin ``` ## Response diff --git a/docs/docs/cmd/aad/o365group/o365group-report-activitycounts.mdx b/docs/docs/cmd/aad/o365group/o365group-report-activitycounts.mdx index 9764715030c..5da01bc6f24 100644 --- a/docs/docs/cmd/aad/o365group/o365group-report-activitycounts.mdx +++ b/docs/docs/cmd/aad/o365group/o365group-report-activitycounts.mdx @@ -18,7 +18,7 @@ m365 aad o365group report activitycounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180` -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft 365 Groups activities across group workloads report should be stored in ``` diff --git a/docs/docs/cmd/aad/o365group/o365group-report-activitydetail.mdx b/docs/docs/cmd/aad/o365group/o365group-report-activitydetail.mdx index 89be1551994..7c0a3b2b790 100644 --- a/docs/docs/cmd/aad/o365group/o365group-report-activitydetail.mdx +++ b/docs/docs/cmd/aad/o365group/o365group-report-activitydetail.mdx @@ -21,7 +21,7 @@ m365 aad o365group report activitydetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is `YYYY-MM-DD`. Specify the `date` or `period`, but not both. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft 365 Groups activity by group report should be stored in ``` diff --git a/docs/docs/cmd/aad/o365group/o365group-report-activityfilecounts.mdx b/docs/docs/cmd/aad/o365group/o365group-report-activityfilecounts.mdx index b9ea7a9e107..12ea81c4850 100644 --- a/docs/docs/cmd/aad/o365group/o365group-report-activityfilecounts.mdx +++ b/docs/docs/cmd/aad/o365group/o365group-report-activityfilecounts.mdx @@ -18,7 +18,7 @@ m365 aad o365group report activityfilecounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180` -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft 365 Groups activities across group workloads report should be stored in ``` diff --git a/docs/docs/cmd/aad/o365group/o365group-report-activitygroupcounts.mdx b/docs/docs/cmd/aad/o365group/o365group-report-activitygroupcounts.mdx index 21ad907196f..deb15e88eba 100644 --- a/docs/docs/cmd/aad/o365group/o365group-report-activitygroupcounts.mdx +++ b/docs/docs/cmd/aad/o365group/o365group-report-activitygroupcounts.mdx @@ -18,7 +18,7 @@ m365 aad o365group report activitygroupcounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180` -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft 365 Groups activities report should be stored in ``` diff --git a/docs/docs/cmd/aad/o365group/o365group-report-activitystorage.mdx b/docs/docs/cmd/aad/o365group/o365group-report-activitystorage.mdx index 0738fc2dabb..b52dba10d2e 100644 --- a/docs/docs/cmd/aad/o365group/o365group-report-activitystorage.mdx +++ b/docs/docs/cmd/aad/o365group/o365group-report-activitystorage.mdx @@ -18,7 +18,7 @@ m365 aad o365group report activitystorage [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180` -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft 365 Groups activities report should be stored in ``` diff --git a/docs/docs/cmd/aad/o365group/o365group-user-remove.mdx b/docs/docs/cmd/aad/o365group/o365group-user-remove.mdx index 049464a024a..93bd9012043 100644 --- a/docs/docs/cmd/aad/o365group/o365group-user-remove.mdx +++ b/docs/docs/cmd/aad/o365group/o365group-user-remove.mdx @@ -28,7 +28,7 @@ m365 aad teams user remove `-n, --userName ` : User's UPN (user principal name), eg. `johndoe@example.com` -`--confirm` +`-f, --force` : Don't prompt for confirming removing the user from the specified Microsoft 365 Group or Microsoft Teams team ``` @@ -49,7 +49,7 @@ m365 aad o365group user remove --groupId '00000000-0000-0000-0000-000000000000' Removes user from the specified Microsoft 365 Group without confirmation ```sh -m365 aad o365group user remove --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' --confirm +m365 aad o365group user remove --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' --force ``` Removes user from the specified Microsoft Teams team diff --git a/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.mdx b/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.mdx index d93ab2feaed..355e1bf3d1e 100644 --- a/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.mdx +++ b/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.mdx @@ -16,7 +16,7 @@ m365 aad oauth2grant remove [options] `-i, --grantId ` : `objectId` of OAuth2 permission grant to remove -`--confirm` +`-f, --force` : Do not prompt for confirmation before removing OAuth2 permission grant ``` @@ -43,7 +43,7 @@ m365 aad oauth2grant remove --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-e Remove the OAuth2 permission grant with ID _YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek_ without being asked for confirmation ```sh -m365 aad oauth2grant remove --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek --confirm +m365 aad oauth2grant remove --grantId YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek --force ``` ## Response diff --git a/docs/docs/cmd/aad/siteclassification/siteclassification-disable.mdx b/docs/docs/cmd/aad/siteclassification/siteclassification-disable.mdx index aef1c6496b6..72fb5643b02 100644 --- a/docs/docs/cmd/aad/siteclassification/siteclassification-disable.mdx +++ b/docs/docs/cmd/aad/siteclassification/siteclassification-disable.mdx @@ -13,7 +13,7 @@ m365 aad siteclassification disable [options] ## Options ```md definition-list -`--confirm` +`-f, --force` : Don't prompt for confirming disabling site classification ``` @@ -30,7 +30,7 @@ m365 aad siteclassification disable Disable site classification without confirmation ```sh -m365 aad siteclassification disable --confirm +m365 aad siteclassification disable --force ``` ## Response diff --git a/docs/docs/cmd/aad/user/user-license-remove.mdx b/docs/docs/cmd/aad/user/user-license-remove.mdx index a3272f6133b..dfa7034cbbb 100644 --- a/docs/docs/cmd/aad/user/user-license-remove.mdx +++ b/docs/docs/cmd/aad/user/user-license-remove.mdx @@ -22,7 +22,7 @@ m365 aad user license remove [options] `--ids ` : A comma separated list of IDs that specify the licenses to remove. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/aad/user/user-recyclebinitem-clear.mdx b/docs/docs/cmd/aad/user/user-recyclebinitem-clear.mdx index 8bf4d3c45ab..3afe354d70a 100644 --- a/docs/docs/cmd/aad/user/user-recyclebinitem-clear.mdx +++ b/docs/docs/cmd/aad/user/user-recyclebinitem-clear.mdx @@ -13,7 +13,7 @@ m365 aad user recyclebinitem clear [options] ## Options ```md definition-list -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -44,7 +44,7 @@ m365 aad user recyclebinitem clear Removes all users from the tenant recycle bin without confirmation prompt ```sh -m365 aad user recyclebinitem clear --confirm +m365 aad user recyclebinitem clear --force ``` ## Response diff --git a/docs/docs/cmd/aad/user/user-recyclebinitem-remove.mdx b/docs/docs/cmd/aad/user/user-recyclebinitem-remove.mdx index 62766605e4d..dea2fdd692d 100644 --- a/docs/docs/cmd/aad/user/user-recyclebinitem-remove.mdx +++ b/docs/docs/cmd/aad/user/user-recyclebinitem-remove.mdx @@ -16,7 +16,7 @@ m365 aad user recyclebinitem remove [options] `--id ` : ID of the deleted user. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -47,7 +47,7 @@ m365 aad user recyclebinitem remove --id 59f80e08-24b1-41f8-8586-16765fd830d3 Removes a specific user from the recycle bin without confirmation prompt ```sh -m365 aad user recyclebinitem remove --id 59f80e08-24b1-41f8-8586-16765fd830d3 --confirm +m365 aad user recyclebinitem remove --id 59f80e08-24b1-41f8-8586-16765fd830d3 --force ``` ## Response diff --git a/docs/docs/cmd/aad/user/user-remove.mdx b/docs/docs/cmd/aad/user/user-remove.mdx index bb1b8492d01..dd6c44cba8d 100644 --- a/docs/docs/cmd/aad/user/user-remove.mdx +++ b/docs/docs/cmd/aad/user/user-remove.mdx @@ -19,7 +19,7 @@ m365 aad user remove [options] `--userName [userName]` : User principal name of the user. Specify either `id` or `userName` but not both. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/context/context-remove.mdx b/docs/docs/cmd/context/context-remove.mdx index 0724c24235d..08d9133938a 100644 --- a/docs/docs/cmd/context/context-remove.mdx +++ b/docs/docs/cmd/context/context-remove.mdx @@ -13,7 +13,7 @@ m365 context remove [options] ## Options ```md definition-list -`--confirm` +`-f, --force` : Don't prompt for confirmation to remove the context ``` @@ -30,7 +30,7 @@ m365 context remove Removes the CLI for Microsoft 365 context in the current working folder and does not prompt for confirmation before deleting. ```sh -m365 context remove --confirm +m365 context remove --force ``` ## Response diff --git a/docs/docs/cmd/context/option/option-remove.mdx b/docs/docs/cmd/context/option/option-remove.mdx index 0ce8da8adcb..4790079c112 100644 --- a/docs/docs/cmd/context/option/option-remove.mdx +++ b/docs/docs/cmd/context/option/option-remove.mdx @@ -16,7 +16,7 @@ m365 context option remove [options] `-n, --name ` : The name of the option which will be deleted from the context -`--confirm` +`-f, --force` : Don't prompt for confirming removing the option ``` @@ -33,7 +33,7 @@ m365 context option remove --name "listName" Removes an already available name from the local context file without confirmation ```sh -m365 context option remove --name "listName" --confirm +m365 context option remove --name "listName" --force ``` ## Response diff --git a/docs/docs/cmd/file/file-list.mdx b/docs/docs/cmd/file/file-list.mdx index edc7d5cc035..47afab988f8 100644 --- a/docs/docs/cmd/file/file-list.mdx +++ b/docs/docs/cmd/file/file-list.mdx @@ -16,7 +16,7 @@ m365 file list [options] `-u, --webUrl ` : The URL of the site where the folder from which to retrieve files is located -`-f, --folderUrl ` +`--folderUrl ` : The server- or site-relative URL of the folder from which to retrieve files `--recursive` diff --git a/docs/docs/cmd/flow/flow-export.mdx b/docs/docs/cmd/flow/flow-export.mdx index fa4bfa4f2f0..347f0be40b7 100644 --- a/docs/docs/cmd/flow/flow-export.mdx +++ b/docs/docs/cmd/flow/flow-export.mdx @@ -31,7 +31,7 @@ m365 flow export [options] `-s, --packageSourceEnvironment [packageSourceEnvironment]` : The name of the source environment from which the exported package was taken -`-f, --format [format]` +`--format [format]` : Export format type. `json,zip`. Default `zip` `-p, --path [path]` diff --git a/docs/docs/cmd/flow/flow-remove.mdx b/docs/docs/cmd/flow/flow-remove.mdx index e5e03b4bb33..7a17435ad33 100644 --- a/docs/docs/cmd/flow/flow-remove.mdx +++ b/docs/docs/cmd/flow/flow-remove.mdx @@ -22,7 +22,7 @@ m365 flow remove [options] `--asAdmin` : Set, to remove the flow as admin -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -47,7 +47,7 @@ m365 flow remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 Removes the specified Power Automate flow owned by the currently signed-in user without confirmation ```sh -m365 flow remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --confirm +m365 flow remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --force ``` Removes the specified Power Automate flow owned by another user @@ -59,7 +59,7 @@ m365 flow remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 Removes the specified Power Automate flow owned by another user without confirmation ```sh -m365 flow remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --asAdmin --confirm +m365 flow remove --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --asAdmin --force ``` ## Response diff --git a/docs/docs/cmd/flow/owner/owner-ensure.mdx b/docs/docs/cmd/flow/owner/owner-ensure.mdx index 82504e21e63..0ab2b0640d4 100644 --- a/docs/docs/cmd/flow/owner/owner-ensure.mdx +++ b/docs/docs/cmd/flow/owner/owner-ensure.mdx @@ -16,7 +16,7 @@ m365 flow owner ensure [options] `-e, --environmentName ` : The name of the environment. -`-f, --flowName ` +`--flowName ` : The name of the Power Automate flow. `--userId [userId]` diff --git a/docs/docs/cmd/flow/owner/owner-list.mdx b/docs/docs/cmd/flow/owner/owner-list.mdx index 70a4db75e24..c40bf9091e5 100644 --- a/docs/docs/cmd/flow/owner/owner-list.mdx +++ b/docs/docs/cmd/flow/owner/owner-list.mdx @@ -18,7 +18,7 @@ m365 flow owner list [options] `-e, --environmentName ` : The name of the environment. -`-f, --flowName ` +`--flowName ` : The name of the Power Automate flow. `--asAdmin` diff --git a/docs/docs/cmd/flow/owner/owner-remove.mdx b/docs/docs/cmd/flow/owner/owner-remove.mdx index 7c10742327f..80a6079795d 100644 --- a/docs/docs/cmd/flow/owner/owner-remove.mdx +++ b/docs/docs/cmd/flow/owner/owner-remove.mdx @@ -16,7 +16,7 @@ m365 flow owner remove [options] `-e, --environmentName ` : The name of the environment. -`-f, --flowName ` +`--flowName ` : The name of the Power Automate flow. `--userId [userId]` @@ -34,7 +34,7 @@ m365 flow owner remove [options] `--asAdmin` : Run the command as admin. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -45,7 +45,7 @@ m365 flow owner remove [options] Remove owner permissions from a specific Power Automate flow for a user by ID without prompting for confirmation ```sh -m365 flow owner remove --userId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --confirm +m365 flow owner remove --userId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --force ``` Remove owner permissions from a specific Power Automate flow for a user by UPN as admin diff --git a/docs/docs/cmd/flow/run/run-cancel.mdx b/docs/docs/cmd/flow/run/run-cancel.mdx index dfead4df31a..6e7f34b3247 100644 --- a/docs/docs/cmd/flow/run/run-cancel.mdx +++ b/docs/docs/cmd/flow/run/run-cancel.mdx @@ -16,7 +16,7 @@ m365 flow run cancel [options] `-n, --name ` : The name of the run to cancel -`-f, --flowName ` +`--flowName ` : The name of the flow to cancel the run for `-e, --environmentName ` diff --git a/docs/docs/cmd/flow/run/run-get.mdx b/docs/docs/cmd/flow/run/run-get.mdx index 2c6ee2385c0..f375c398b97 100644 --- a/docs/docs/cmd/flow/run/run-get.mdx +++ b/docs/docs/cmd/flow/run/run-get.mdx @@ -18,7 +18,7 @@ m365 flow run get [options] `-n, --name ` : The name of the run to get information about -`-f, --flowName ` +`--flowName ` : The name of the Power Automate flow for which to retrieve information `-e, --environmentName ` diff --git a/docs/docs/cmd/flow/run/run-list.mdx b/docs/docs/cmd/flow/run/run-list.mdx index 225c7cdabfc..055d230f4fc 100644 --- a/docs/docs/cmd/flow/run/run-list.mdx +++ b/docs/docs/cmd/flow/run/run-list.mdx @@ -15,7 +15,7 @@ m365 flow run list [options] ## Options ```md definition-list -`-f, --flowName ` +`--flowName ` : The name of the Microsoft Flow to retrieve the runs for `-e, --environmentName ` diff --git a/docs/docs/cmd/flow/run/run-resubmit.mdx b/docs/docs/cmd/flow/run/run-resubmit.mdx index c57424ae8a6..42d02e59f27 100644 --- a/docs/docs/cmd/flow/run/run-resubmit.mdx +++ b/docs/docs/cmd/flow/run/run-resubmit.mdx @@ -16,13 +16,13 @@ m365 flow run resubmit [options] `-n, --name ` : The name of the run to resubmit -`-f, --flowName ` +`--flowName ` : The name of the flow to resubmit the run for `-e, --environmentName ` : The name of the environment where the Flow is located -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -53,7 +53,7 @@ m365 flow run resubmit --environmentName Default-d87a7535-dd31-4437-bfe1-95340ac Resubmits a specific flow run for the specified Microsoft Flow without prompting for confirmation ```sh -m365 flow run resubmit --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --name 08586653536760200319026785874CU62 --confirm +m365 flow run resubmit --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --name 08586653536760200319026785874CU62 --force ``` ## Response diff --git a/docs/docs/cmd/graph/schemaextension/schemaextension-remove.mdx b/docs/docs/cmd/graph/schemaextension/schemaextension-remove.mdx index 2a140f9685e..05417e22334 100644 --- a/docs/docs/cmd/graph/schemaextension/schemaextension-remove.mdx +++ b/docs/docs/cmd/graph/schemaextension/schemaextension-remove.mdx @@ -16,7 +16,7 @@ m365 graph schemaextension remove [options] `-i, --id ` : The unique identifier for the schema extension definition -`--confirm` +`-f, --force` : Don't prompt for confirming removing the specified schema extension ``` @@ -38,7 +38,7 @@ m365 graph schemaextension remove --id domain_myExtension Removes specified Microsoft Graph schema extension with ID domain_myExtension without prompt for confirmation ```sh -m365 graph schemaextension remove --id domain_myExtension --confirm +m365 graph schemaextension remove --id domain_myExtension --force ``` ## Response diff --git a/docs/docs/cmd/onedrive/report/report-activityfilecounts.mdx b/docs/docs/cmd/onedrive/report/report-activityfilecounts.mdx index 05591895efb..64b5a63cb19 100644 --- a/docs/docs/cmd/onedrive/report/report-activityfilecounts.mdx +++ b/docs/docs/cmd/onedrive/report/report-activityfilecounts.mdx @@ -18,7 +18,7 @@ m365 onedrive report activityfilecounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/onedrive/report/report-activityusercounts.mdx b/docs/docs/cmd/onedrive/report/report-activityusercounts.mdx index 12f767055b7..f5bd0e96961 100644 --- a/docs/docs/cmd/onedrive/report/report-activityusercounts.mdx +++ b/docs/docs/cmd/onedrive/report/report-activityusercounts.mdx @@ -18,7 +18,7 @@ m365 onedrive report activityusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/onedrive/report/report-activityuserdetail.mdx b/docs/docs/cmd/onedrive/report/report-activityuserdetail.mdx index 7759ddbb74c..ed3c679ebfc 100644 --- a/docs/docs/cmd/onedrive/report/report-activityuserdetail.mdx +++ b/docs/docs/cmd/onedrive/report/report-activityuserdetail.mdx @@ -21,7 +21,7 @@ m365 onedrive report activityuserdetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is YYYY-MM-DD. Specify the date or period, but not both` -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/onedrive/report/report-usageaccountcounts.mdx b/docs/docs/cmd/onedrive/report/report-usageaccountcounts.mdx index 02b465d450e..dd9b578f93d 100644 --- a/docs/docs/cmd/onedrive/report/report-usageaccountcounts.mdx +++ b/docs/docs/cmd/onedrive/report/report-usageaccountcounts.mdx @@ -18,7 +18,7 @@ m365 onedrive report usageaccountcounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/onedrive/report/report-usageaccountdetail.mdx b/docs/docs/cmd/onedrive/report/report-usageaccountdetail.mdx index 339b0e3f161..83f5366dd09 100644 --- a/docs/docs/cmd/onedrive/report/report-usageaccountdetail.mdx +++ b/docs/docs/cmd/onedrive/report/report-usageaccountdetail.mdx @@ -21,7 +21,7 @@ m365 onedrive report usageaccountdetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is YYYY-MM-DD. Specify the date or period, but not both` -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/onedrive/report/report-usagefilecounts.mdx b/docs/docs/cmd/onedrive/report/report-usagefilecounts.mdx index c57c46ef02d..7e6cf2b6d45 100644 --- a/docs/docs/cmd/onedrive/report/report-usagefilecounts.mdx +++ b/docs/docs/cmd/onedrive/report/report-usagefilecounts.mdx @@ -18,7 +18,7 @@ m365 onedrive report usagefilecounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/onedrive/report/report-usagestorage.mdx b/docs/docs/cmd/onedrive/report/report-usagestorage.mdx index 6a100032ad6..a1dd4001a2a 100644 --- a/docs/docs/cmd/onedrive/report/report-usagestorage.mdx +++ b/docs/docs/cmd/onedrive/report/report-usagestorage.mdx @@ -18,7 +18,7 @@ m365 onedrive report usagestorage [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailactivitycounts.mdx b/docs/docs/cmd/outlook/report/report-mailactivitycounts.mdx index 40fd1972e5a..24787bc917c 100644 --- a/docs/docs/cmd/outlook/report/report-mailactivitycounts.mdx +++ b/docs/docs/cmd/outlook/report/report-mailactivitycounts.mdx @@ -18,7 +18,7 @@ m365 outlook report mailactivitycounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailactivityusercounts.mdx b/docs/docs/cmd/outlook/report/report-mailactivityusercounts.mdx index 53a30318272..3ebf4c8f763 100644 --- a/docs/docs/cmd/outlook/report/report-mailactivityusercounts.mdx +++ b/docs/docs/cmd/outlook/report/report-mailactivityusercounts.mdx @@ -18,7 +18,7 @@ m365 outlook report mailactivityusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.mdx b/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.mdx index 13f4f74aa4d..aa0a4b3e656 100644 --- a/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.mdx +++ b/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.mdx @@ -21,7 +21,7 @@ m365 outlook report mailactivityuserdetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is YYYY-MM-DD. Specify the date or period, but not both -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.mdx b/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.mdx index 08d6f2fa5e1..58a35b5dade 100644 --- a/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.mdx +++ b/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.mdx @@ -18,7 +18,7 @@ m365 outlook report mailappusageappsusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailappusageusercounts.mdx b/docs/docs/cmd/outlook/report/report-mailappusageusercounts.mdx index c45fcb99c7b..4e6b5bb7960 100644 --- a/docs/docs/cmd/outlook/report/report-mailappusageusercounts.mdx +++ b/docs/docs/cmd/outlook/report/report-mailappusageusercounts.mdx @@ -18,7 +18,7 @@ m365 outlook report mailappusageusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.mdx b/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.mdx index 66d7339ac03..7bd13483b86 100644 --- a/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.mdx +++ b/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.mdx @@ -21,7 +21,7 @@ m365 outlook report mailappusageuserdetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is YYYY-MM-DD. Specify the date or period, but not both -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.mdx b/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.mdx index b70bb35a3b9..743e5e90ee5 100644 --- a/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.mdx +++ b/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.mdx @@ -18,7 +18,7 @@ m365 outlook report mailappusageversionsusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailboxusagedetail.mdx b/docs/docs/cmd/outlook/report/report-mailboxusagedetail.mdx index 63ab75cc01c..5b571c4a5d9 100644 --- a/docs/docs/cmd/outlook/report/report-mailboxusagedetail.mdx +++ b/docs/docs/cmd/outlook/report/report-mailboxusagedetail.mdx @@ -18,7 +18,7 @@ m365 outlook report mailboxusagedetail [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.mdx b/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.mdx index 4233a490286..e436215d085 100644 --- a/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.mdx +++ b/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.mdx @@ -18,7 +18,7 @@ m365 outlook report mailboxusagemailboxcount [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.mdx b/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.mdx index b61a1590995..f15afbf54a1 100644 --- a/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.mdx +++ b/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.mdx @@ -18,7 +18,7 @@ m365 outlook report mailboxusagequotastatusmailboxcounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/outlook/report/report-mailboxusagestorage.mdx b/docs/docs/cmd/outlook/report/report-mailboxusagestorage.mdx index 6df14df3555..6639aea6049 100644 --- a/docs/docs/cmd/outlook/report/report-mailboxusagestorage.mdx +++ b/docs/docs/cmd/outlook/report/report-mailboxusagestorage.mdx @@ -18,7 +18,7 @@ m365 outlook report mailboxusagestorage [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/pa/app/app-consent-set.mdx b/docs/docs/cmd/pa/app/app-consent-set.mdx index 916efa5c918..bbeaba8b005 100644 --- a/docs/docs/cmd/pa/app/app-consent-set.mdx +++ b/docs/docs/cmd/pa/app/app-consent-set.mdx @@ -22,7 +22,7 @@ m365 pa app consent set [options] `-b, --bypass ` : Set to `true` to allow users to bypass the API Consent window. Set to `false` to disable the bypass. -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -43,7 +43,7 @@ m365 pa app consent set --environment 4be50206-9576-4237-8b17-38d8aadfaa36 --nam 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 --confirm +m365 pa app consent set --environment 4be50206-9576-4237-8b17-38d8aadfaa36 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --bypass false --force ``` ## Response diff --git a/docs/docs/cmd/pa/app/app-remove.mdx b/docs/docs/cmd/pa/app/app-remove.mdx index da4d7008a94..3d0d43372cc 100644 --- a/docs/docs/cmd/pa/app/app-remove.mdx +++ b/docs/docs/cmd/pa/app/app-remove.mdx @@ -16,7 +16,7 @@ m365 pa app remove [options] `-n, --name ` : The name of the Power App to remove -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -41,7 +41,7 @@ m365 pa app remove --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d Removes the specified Power App without confirmation ```sh -m365 pa app remove --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --confirm +m365 pa app remove --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --force ``` ## Response diff --git a/docs/docs/cmd/planner/bucket/bucket-remove.mdx b/docs/docs/cmd/planner/bucket/bucket-remove.mdx index bc26fd2e53c..21e2469bcf6 100644 --- a/docs/docs/cmd/planner/bucket/bucket-remove.mdx +++ b/docs/docs/cmd/planner/bucket/bucket-remove.mdx @@ -34,7 +34,7 @@ m365 planner bucket remove [options] `--ownerGroupName [ownerGroupName]` : Name of the group to which the plan belongs. Specify either `ownerGroupId` or `ownerGroupName` when using `planTitle`. -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -59,7 +59,7 @@ m365 planner bucket remove --id "vncYUXCRBke28qMLB-d4xJcACtNz" Removes the Microsoft Planner bucket by ID without confirmation ```sh -m365 planner bucket remove --id "vncYUXCRBke28qMLB-d4xJcACtNz" --confirm +m365 planner bucket remove --id "vncYUXCRBke28qMLB-d4xJcACtNz" --force ``` Removes the Microsoft Planner bucket by its name based on the plan ID diff --git a/docs/docs/cmd/planner/plan/plan-remove.mdx b/docs/docs/cmd/planner/plan/plan-remove.mdx index a17272a9a25..c1827e010d0 100644 --- a/docs/docs/cmd/planner/plan/plan-remove.mdx +++ b/docs/docs/cmd/planner/plan/plan-remove.mdx @@ -25,7 +25,7 @@ m365 planner plan remove [options] `--ownerGroupName [ownerGroupName]` : Name of the Group that owns the plan. Specify either `ownerGroupId` or `ownerGroupName` when using `title`. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -52,7 +52,7 @@ m365 planner plan remove --title "My Plan" --ownerGroupId 00000000-0000-0000-000 Removes the Microsoft Planner plan with title _My Plan_ in group with name _My Planner Group_ without confirmation prompt ```sh -m365 planner plan remove --title "My Plan" --ownerGroupName "My Planner Group" --confirm +m365 planner plan remove --title "My Plan" --ownerGroupName "My Planner Group" --force ``` ## Response diff --git a/docs/docs/cmd/planner/roster/roster-member-remove.mdx b/docs/docs/cmd/planner/roster/roster-member-remove.mdx index 8cf5e5f04b6..e44ec631701 100644 --- a/docs/docs/cmd/planner/roster/roster-member-remove.mdx +++ b/docs/docs/cmd/planner/roster/roster-member-remove.mdx @@ -22,7 +22,7 @@ m365 planner roster member remove [options] `--userName [userName]` : User's UPN (user principal name, e.g. johndoe@example.com). Specify either `userId` or `userName` but not both. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -38,7 +38,7 @@ This command is based on an API that is currently in preview and is subject to c :::caution -The Planner Roster will be deleted when it doesn't have any users remaining in the membership list because the last user removed themselves. Roster, its plan and all contained tasks will be deleted within 30 days of this operation. We will show an extra prompt when this happens. This prompt is also suppressed when specifying `--confirm`. +The Planner Roster will be deleted when it doesn't have any users remaining in the membership list because the last user removed themselves. Roster, its plan and all contained tasks will be deleted within 30 days of this operation. We will show an extra prompt when this happens. This prompt is also suppressed when specifying `-f, --force`. ::: diff --git a/docs/docs/cmd/planner/roster/roster-remove.mdx b/docs/docs/cmd/planner/roster/roster-remove.mdx index 62871bb57a1..1dfce9a8e96 100644 --- a/docs/docs/cmd/planner/roster/roster-remove.mdx +++ b/docs/docs/cmd/planner/roster/roster-remove.mdx @@ -16,7 +16,7 @@ m365 planner roster remove [options] `--id ` : ID of the Planner Roster. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -47,7 +47,7 @@ m365 planner roster remove --id tYqYlNd6eECmsNhN_fcq85cAGAnd Removes a Planner Roster without confirmation prompt ```sh -m365 planner roster remove --id tYqYlNd6eECmsNhN_fcq85cAGAnd --confirm +m365 planner roster remove --id tYqYlNd6eECmsNhN_fcq85cAGAnd --force ``` ## Response diff --git a/docs/docs/cmd/planner/task/task-checklistitem-remove.mdx b/docs/docs/cmd/planner/task/task-checklistitem-remove.mdx index 3b7c89467df..04c76c379e6 100644 --- a/docs/docs/cmd/planner/task/task-checklistitem-remove.mdx +++ b/docs/docs/cmd/planner/task/task-checklistitem-remove.mdx @@ -19,7 +19,7 @@ m365 planner task checklistitem remove [options] `--taskId ` : ID of the task. -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -36,7 +36,7 @@ m365 planner task checklistitem remove --id "40012" --taskId "2Vf8JHgsBUiIf-nuvB Removes a checklist item with the id _40012_ from the Planner task with the id _2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2_ without prompt ```sh -m365 planner task checklistitem remove --id "40012" --taskId "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" --confirm +m365 planner task checklistitem remove --id "40012" --taskId "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" --force ``` ## Response diff --git a/docs/docs/cmd/planner/task/task-reference-remove.mdx b/docs/docs/cmd/planner/task/task-reference-remove.mdx index 92ec2abbff9..7670c2667d2 100644 --- a/docs/docs/cmd/planner/task/task-reference-remove.mdx +++ b/docs/docs/cmd/planner/task/task-reference-remove.mdx @@ -22,7 +22,7 @@ m365 planner task reference remove [options] `-i, --taskId ` : ID of the task. -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` diff --git a/docs/docs/cmd/planner/task/task-remove.mdx b/docs/docs/cmd/planner/task/task-remove.mdx index 8208432350f..e006a3e516e 100644 --- a/docs/docs/cmd/planner/task/task-remove.mdx +++ b/docs/docs/cmd/planner/task/task-remove.mdx @@ -37,7 +37,7 @@ m365 planner task remove [options] `--ownerGroupName [ownerGroupName]` : Name of the group to which the plan belongs. Specify either `ownerGroupId` or `ownerGroupName` when using `planTitle`. -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -54,7 +54,7 @@ m365 planner task remove --id "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" Removes the Microsoft Planner task by ID without confirmation ```sh -m365 planner task remove --id "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" --confirm +m365 planner task remove --id "2Vf8JHgsBUiIf-nuvBtv-ZgAAYw2" --force ``` Removes the Microsoft Planner task with title _My Task_ in the bucket with ID _vncYUXCRBke28qMLB-d4xJcACtNz_ diff --git a/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.mdx b/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.mdx index 408caf5fdc8..4e082ab8bb1 100644 --- a/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.mdx +++ b/docs/docs/cmd/pp/aibuildermodel/aibuildermodel-remove.mdx @@ -25,7 +25,7 @@ m365 pp aibuildermodel remove [options] `--asAdmin` : Run the command as admin for environments you do not have explicitly assigned permissions to. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -42,7 +42,7 @@ m365 pp aibuildermodel remove --environment Default-d87a7535-dd31-4437-bfe1-9534 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" --confirm +m365 pp aibuildermodel remove --environment 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 diff --git a/docs/docs/cmd/pp/card/card-remove.mdx b/docs/docs/cmd/pp/card/card-remove.mdx index efa93835916..e4d443e3244 100644 --- a/docs/docs/cmd/pp/card/card-remove.mdx +++ b/docs/docs/cmd/pp/card/card-remove.mdx @@ -25,7 +25,7 @@ m365 pp card remove [options] `--asAdmin` : Run the command as admin for environments you do not have explicitly assigned permissions to. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -42,7 +42,7 @@ m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 - 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" --confirm +m365 pp card remove --environment 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 @@ -54,7 +54,7 @@ m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 - 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 --confirm +m365 pp card remove --environment 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 @@ -66,7 +66,7 @@ m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 - 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 --confirm +m365 pp card remove --environment 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 @@ -78,7 +78,7 @@ m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 - 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 --confirm +m365 pp card remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 9d9a13d0-6255-ed11-bba2-000d3adf774e --asAdmin --force ``` ## Response diff --git a/docs/docs/cmd/pp/chatbot/chatbot-remove.mdx b/docs/docs/cmd/pp/chatbot/chatbot-remove.mdx index 14ef252d497..8ac11e1a145 100644 --- a/docs/docs/cmd/pp/chatbot/chatbot-remove.mdx +++ b/docs/docs/cmd/pp/chatbot/chatbot-remove.mdx @@ -25,7 +25,7 @@ m365 pp chatbot remove [options] `--asAdmin` : Run the command as admin for environments you do not have explicitly assigned permissions to. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -42,7 +42,7 @@ m365 pp chatbot remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c 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 --confirm +m365 pp chatbot remove --environment 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 diff --git a/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx b/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx index 4d5abca152c..02808ef53aa 100644 --- a/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx +++ b/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx @@ -19,7 +19,7 @@ m365 pp dataverse table remove [options] `-n, --name` : The name of the dataverse table to remove. -`--confirm` +`-f, --force` : Don't prompt for confirmation `--asAdmin` @@ -45,7 +45,7 @@ m365 pp dataverse table remove -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" Removes a dataverse table in a given environment without prompting for confirmation ```sh -m365 pp dataverse table remove -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --confirm +m365 pp dataverse table remove -e "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --name "aaduser" --force ``` ## Response 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 ea5e8aae16a..5d2df7982aa 100644 --- a/docs/docs/cmd/pp/dataverse/dataverse-table-row-remove.mdx +++ b/docs/docs/cmd/pp/dataverse/dataverse-table-row-remove.mdx @@ -25,7 +25,7 @@ m365 pp dataverse table row remove [options] `--tableName [tableName]` : The name of the table. Specify either `entitySetName` or `tableName` but not both -`--confirm` +`-f, --force` : Don't prompt for confirmation `--asAdmin` @@ -51,13 +51,13 @@ m365 pp dataverse table row remove --environment "Default-2ca3eaa5-140f-4175-826 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" --confirm +m365 pp dataverse table row remove --environment "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" --confirm +m365 pp dataverse table row remove --environment "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-publisher-remove.mdx b/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx index 338876d414c..3fcec4e6fde 100644 --- a/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx +++ b/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx @@ -25,7 +25,7 @@ m365 pp solution publisher remove [options] `--asAdmin` : Run the command as admin for environments you do not have explicitly assigned permissions to. -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -42,7 +42,7 @@ m365 pp solution publisher remove --environment Default-d87a7535-dd31-4437-bfe1- 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" --confirm +m365 pp solution publisher remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Publisher Name" --force ``` Removes the specified publisher based on the name parameter as admin diff --git a/docs/docs/cmd/pp/solution/solution-remove.mdx b/docs/docs/cmd/pp/solution/solution-remove.mdx index e8139c99f8b..9843dabb690 100644 --- a/docs/docs/cmd/pp/solution/solution-remove.mdx +++ b/docs/docs/cmd/pp/solution/solution-remove.mdx @@ -25,7 +25,7 @@ m365 pp solution remove [options] `--asAdmin` : Run the command as admin for environments you do not have explicitly assigned permissions to. -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -42,7 +42,7 @@ m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55 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" --confirm +m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --name "Solution Name" --force ``` Removes the specified solution owned by another user based on the name parameter @@ -54,7 +54,7 @@ m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55 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 --confirm +m365 pp solution remove --environment 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 @@ -66,7 +66,7 @@ m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55 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 --confirm +m365 pp solution remove --environment 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 @@ -78,7 +78,7 @@ m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55 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 --confirm +m365 pp solution remove --environment Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --id 00000001-0000-0000-0001-00000000009b --asAdmin --force ``` ## Response diff --git a/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx b/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx index 9950e152841..29be446b223 100644 --- a/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx +++ b/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx @@ -16,7 +16,7 @@ m365 purview retentionevent remove [options] `-i, --id ` : The Id of the retention event. -`--confirm` +`-f, --force` : Don't prompt for confirmation to remove the retention event. ``` diff --git a/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx b/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx index 9d01c45f682..517afe33234 100644 --- a/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx +++ b/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx @@ -16,7 +16,7 @@ m365 purview retentioneventtype remove [options] `-i, --id ` : The Id of the retention event type. -`--confirm` +`-f, --force` : Don't prompt for confirmation to remove the retention event type. ``` diff --git a/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx b/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx index bf25763a582..116ed5e5535 100644 --- a/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx +++ b/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx @@ -16,7 +16,7 @@ m365 purview retentionlabel remove [options] `-i, --id ` : The Id of the retention label. -`--confirm` +`-f, --force` : Don't prompt for confirming to remove the label. ``` diff --git a/docs/docs/cmd/search/externalconnection/externalconnection-remove.mdx b/docs/docs/cmd/search/externalconnection/externalconnection-remove.mdx index 91cb0861b23..257b1386c1b 100644 --- a/docs/docs/cmd/search/externalconnection/externalconnection-remove.mdx +++ b/docs/docs/cmd/search/externalconnection/externalconnection-remove.mdx @@ -19,7 +19,7 @@ m365 search externalconnection remove [options] `-n, --name [name]` : Name of the External Connection to remove. Specify either `id` or `name` -`--confirm` +`-f, --force` : Don't prompt for confirming removing the connection ``` @@ -40,7 +40,7 @@ m365 search externalconnection remove --id "MyApp" Removes external connection with name _Test_. Will NOT prompt for confirmation before removing. ```sh -m365 search externalconnection remove --name "Test" --confirm +m365 search externalconnection remove --name "Test" --force ``` ## Response diff --git a/docs/docs/cmd/skype/report/report-activitycounts.mdx b/docs/docs/cmd/skype/report/report-activitycounts.mdx index 9a604f229a8..6ede7adb71b 100644 --- a/docs/docs/cmd/skype/report/report-activitycounts.mdx +++ b/docs/docs/cmd/skype/report/report-activitycounts.mdx @@ -17,7 +17,7 @@ m365 skype report activitycounts [options] ```md definition-list `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/skype/report/report-activityusercounts.mdx b/docs/docs/cmd/skype/report/report-activityusercounts.mdx index a908d4d24a6..eaae3a3fbb8 100644 --- a/docs/docs/cmd/skype/report/report-activityusercounts.mdx +++ b/docs/docs/cmd/skype/report/report-activityusercounts.mdx @@ -18,7 +18,7 @@ m365 skype report activityusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/skype/report/report-activityuserdetail.mdx b/docs/docs/cmd/skype/report/report-activityuserdetail.mdx index 8da68211fb9..d62925d9482 100644 --- a/docs/docs/cmd/skype/report/report-activityuserdetail.mdx +++ b/docs/docs/cmd/skype/report/report-activityuserdetail.mdx @@ -21,7 +21,7 @@ m365 skype report activityuserdetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is YYYY-MM-DD. Specify the date or period, but not both -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/spfx/project/project-externalize.mdx b/docs/docs/cmd/spfx/project/project-externalize.mdx index e786647f568..755c10ff057 100644 --- a/docs/docs/cmd/spfx/project/project-externalize.mdx +++ b/docs/docs/cmd/spfx/project/project-externalize.mdx @@ -14,7 +14,7 @@ m365 spfx project externalize [options] ## Options ```md definition-list -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in `-h, --help` diff --git a/docs/docs/cmd/spfx/project/project-upgrade.mdx b/docs/docs/cmd/spfx/project/project-upgrade.mdx index 771b14fbd22..e0fb41c3143 100644 --- a/docs/docs/cmd/spfx/project/project-upgrade.mdx +++ b/docs/docs/cmd/spfx/project/project-upgrade.mdx @@ -27,7 +27,7 @@ m365 spfx project upgrade [options] `--preview` : Upgrade project to the latest SPFx preview version -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the upgrade report should be stored in. Ignored when `output` is `tour` ``` diff --git a/docs/docs/cmd/spo/app/app-remove.mdx b/docs/docs/cmd/spo/app/app-remove.mdx index e590817b716..130af804a23 100644 --- a/docs/docs/cmd/spo/app/app-remove.mdx +++ b/docs/docs/cmd/spo/app/app-remove.mdx @@ -22,7 +22,7 @@ m365 spo app remove [options] `-s, --appCatalogScope [appCatalogScope]` : Scope of the app catalog: `tenant,sitecollection`. Default `tenant` -`--confirm` +`-f, --force` : Don't prompt for confirming removing the app ``` @@ -53,7 +53,7 @@ m365 spo app remove --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --appCatalogUrl ht Remove the specified app from the tenant app catalog located at _https://contoso.sharepoint.com/sites/apps_. Don't prompt for confirmation. ```sh -m365 spo app remove --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --appCatalogUrl https://contoso.sharepoint.com/sites/apps --confirm +m365 spo app remove --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --appCatalogUrl https://contoso.sharepoint.com/sites/apps --force ``` Remove the specified app from a site collection app catalog of site _https://contoso.sharepoint.com/sites/site1_. diff --git a/docs/docs/cmd/spo/app/app-retract.mdx b/docs/docs/cmd/spo/app/app-retract.mdx index eadb7303f36..15cc2fd1cbe 100644 --- a/docs/docs/cmd/spo/app/app-retract.mdx +++ b/docs/docs/cmd/spo/app/app-retract.mdx @@ -22,7 +22,7 @@ m365 spo app retract [options] `-s, --appCatalogScope [appCatalogScope]` : Scope of the app catalog: `tenant,sitecollection`. Default `tenant` -`--confirm` +`-f, --force` : Don't prompt for confirming retracting the app ``` @@ -53,7 +53,7 @@ m365 spo app retract --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --appCatalogUrl h Retract the specified app from the tenant app catalog. Try to resolve the URL of the tenant app catalog automatically. Will not prompt for confirmation before retracting the app. ```sh -m365 spo app retract --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --confirm +m365 spo app retract --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --force ``` Retract the specified app from a site collection app catalog of site _https://contoso.sharepoint.com/sites/site1_. diff --git a/docs/docs/cmd/spo/app/app-uninstall.mdx b/docs/docs/cmd/spo/app/app-uninstall.mdx index 11c56c5b0bf..b779fd96887 100644 --- a/docs/docs/cmd/spo/app/app-uninstall.mdx +++ b/docs/docs/cmd/spo/app/app-uninstall.mdx @@ -22,7 +22,7 @@ m365 spo app uninstall [options] `--appCatalogScope [appCatalogScope]` : Scope of the app catalog: `tenant,sitecollection`. Default `tenant` -`--confirm` +`-f, --force` : Don't prompt for confirming uninstalling the app ``` diff --git a/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.mdx b/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.mdx index 6bdc51f6ffb..96fba89c66f 100644 --- a/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.mdx +++ b/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-remove.mdx @@ -28,7 +28,7 @@ m365 spo applicationcustomizer remove [options] `-s, --scope [scope]` : Scope of the application customizer. Allowed values: `Site`, `Web`, and `All`. Defaults to `All`. -`--confirm` +`-f, --force` : Don't prompt for confirming removal of the application customizer. ``` @@ -61,19 +61,19 @@ m365 spo applicationcustomizer remove --clientSideComponentId 7096cded-b83d-4eab Remove an application customizer by its id without prompting for confirmation ```sh -m365 spo applicationcustomizer remove --id 14125658-a9bc-4ddf-9c75-1b5767c9a337 --webUrl https://contoso.sharepoint.com/sites/sales --confirm +m365 spo applicationcustomizer remove --id 14125658-a9bc-4ddf-9c75-1b5767c9a337 --webUrl https://contoso.sharepoint.com/sites/sales --force ``` Remove an application customizer from a site collection by its id without prompting for confirmation ```sh -m365 spo applicationcustomizer remove --id 14125658-a9bc-4ddf-9c75-1b5767c9a337 --webUrl https://contoso.sharepoint.com/sites/sales --confirm --scope Site +m365 spo applicationcustomizer remove --id 14125658-a9bc-4ddf-9c75-1b5767c9a337 --webUrl https://contoso.sharepoint.com/sites/sales --force --scope Site ``` Remove an application customizer from a site by its id without prompting for confirmation ```sh -m365 spo applicationcustomizer remove --id 14125658-a9bc-4ddf-9c75-1b5767c9a337 --webUrl https://contoso.sharepoint.com/sites/sales --confirm --scope Web +m365 spo applicationcustomizer remove --id 14125658-a9bc-4ddf-9c75-1b5767c9a337 --webUrl https://contoso.sharepoint.com/sites/sales --force --scope Web ``` ## Response diff --git a/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx b/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx index a10ac16c6bf..7ba26c784c7 100644 --- a/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx +++ b/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx @@ -19,7 +19,7 @@ m365 spo cdn origin remove [options] `-r, --origin ` : Origin to remove from the current CDN configuration -`--confirm` +`-f, --force` : Don't prompt for confirming removal of a tenant property ``` diff --git a/docs/docs/cmd/spo/commandset/commandset-remove.mdx b/docs/docs/cmd/spo/commandset/commandset-remove.mdx index cf6df2fd092..5bbb6b20d96 100644 --- a/docs/docs/cmd/spo/commandset/commandset-remove.mdx +++ b/docs/docs/cmd/spo/commandset/commandset-remove.mdx @@ -28,7 +28,7 @@ m365 spo commandset remove [options] `-s, --scope [scope]` : Scope of the ListView Command Set. Allowed values: `Site`, `Web`, `All`. Defaults to `All`. -`--confirm` +`-f, --force` : Don't prompt for confirming removal of the ListView Command Set ``` diff --git a/docs/docs/cmd/spo/contenttype/contenttype-field-remove.mdx b/docs/docs/cmd/spo/contenttype/contenttype-field-remove.mdx index ccdcd044b77..b99f989a622 100644 --- a/docs/docs/cmd/spo/contenttype/contenttype-field-remove.mdx +++ b/docs/docs/cmd/spo/contenttype/contenttype-field-remove.mdx @@ -28,13 +28,13 @@ m365 spo contenttype field remove [options] `-i, --contentTypeId ` : The ID of the content type to remove the column from -`-f, --fieldLinkId ` +`--fieldLinkId ` : The ID of the column to remove `-c, --updateChildContentTypes` : Update child content types -`--confirm` +`-f, --force` : Don't prompt for confirming removal of a column from content type ``` @@ -45,7 +45,7 @@ m365 spo contenttype field remove [options] Remove column with a specific ID from a content type with a specific ID from a specific site. ```sh -m365 spo contenttype field remove --contentTypeId "0x0100CA0FA0F5DAEF784494B9C6020C3020A6" --fieldLinkId "880d2f46-fccb-43ca-9def-f88e722cef80" --webUrl https://contoso.sharepoint.com --confirm +m365 spo contenttype field remove --contentTypeId "0x0100CA0FA0F5DAEF784494B9C6020C3020A6" --fieldLinkId "880d2f46-fccb-43ca-9def-f88e722cef80" --webUrl https://contoso.sharepoint.com --force ``` Remove column with a specific ID from a content type with a specific ID from a specific site and updating the child content types diff --git a/docs/docs/cmd/spo/contenttype/contenttype-field-set.mdx b/docs/docs/cmd/spo/contenttype/contenttype-field-set.mdx index 013f259aa94..27f02ed216c 100644 --- a/docs/docs/cmd/spo/contenttype/contenttype-field-set.mdx +++ b/docs/docs/cmd/spo/contenttype/contenttype-field-set.mdx @@ -19,7 +19,7 @@ m365 spo contenttype field set [options] `-c, --contentTypeId ` : ID of the content type on which the field reference should be set -`-f, --id ` +`--id ` : ID of the field to which the reference should be set `-r, --required [required]` diff --git a/docs/docs/cmd/spo/contenttype/contenttype-remove.mdx b/docs/docs/cmd/spo/contenttype/contenttype-remove.mdx index dc926158774..e1d7e0527c2 100644 --- a/docs/docs/cmd/spo/contenttype/contenttype-remove.mdx +++ b/docs/docs/cmd/spo/contenttype/contenttype-remove.mdx @@ -22,7 +22,7 @@ m365 spo contenttype remove [options] `-n, --name [name]` : The name of the content type to remove -`--confirm` +`-f, --force` : Don't prompt for confirming removal of the content type ``` @@ -45,11 +45,11 @@ m365 spo contenttype remove --id "0x01007926A45D687BA842B947286090B8F67D" --webU Remove a site content type by Name ```sh -m365 spo contenttype remove --name "My Content Type" --webUrl https://contoso.sharepoint.com --confirm +m365 spo contenttype remove --name "My Content Type" --webUrl https://contoso.sharepoint.com --force ``` Remove a site content type without prompting for confirmation ```sh -m365 spo contenttype remove --name "My Content Type" --webUrl https://contoso.sharepoint.com --confirm +m365 spo contenttype remove --name "My Content Type" --webUrl https://contoso.sharepoint.com --force ``` diff --git a/docs/docs/cmd/spo/customaction/customaction-clear.mdx b/docs/docs/cmd/spo/customaction/customaction-clear.mdx index d341d15ae04..09121cec9fd 100644 --- a/docs/docs/cmd/spo/customaction/customaction-clear.mdx +++ b/docs/docs/cmd/spo/customaction/customaction-clear.mdx @@ -19,7 +19,7 @@ m365 spo customaction clear [options] `-s, --scope [scope]` : Scope of the custom action. Allowed values `Site`, `Web`, `All`. Default `All` -`--confirm` +`-f, --force` : Don't prompt for confirming removing all custom actions ``` @@ -31,7 +31,7 @@ Clears all user custom actions for both site and site collection _https://contos Skips the confirmation prompt message. ```sh -m365 spo customaction clear --webUrl https://contoso.sharepoint.com/sites/test --confirm +m365 spo customaction clear --webUrl https://contoso.sharepoint.com/sites/test --force ``` Clears all user custom actions for site _https://contoso.sharepoint.com/sites/test_. diff --git a/docs/docs/cmd/spo/customaction/customaction-remove.mdx b/docs/docs/cmd/spo/customaction/customaction-remove.mdx index cb76166722c..aa272de9db4 100644 --- a/docs/docs/cmd/spo/customaction/customaction-remove.mdx +++ b/docs/docs/cmd/spo/customaction/customaction-remove.mdx @@ -25,7 +25,7 @@ m365 spo customaction remove [options] `-s, --scope [scope]` : Scope of the custom action. Allowed values `Site`, `Web`, `All`. Default `All` -`--confirm` +`-f, --force` : Don't prompt for confirming removal of a user custom action ``` @@ -52,13 +52,13 @@ m365 spo customaction remove --title "YourAppCustomizer" --webUrl https://contos Removes user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site or site collection _https://contoso.sharepoint.com/sites/test_. Skips the confirmation prompt message. ```sh -m365 spo customaction remove --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --webUrl https://contoso.sharepoint.com/sites/test --confirm +m365 spo customaction remove --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --webUrl https://contoso.sharepoint.com/sites/test --force ``` Removes user custom action with Title _YourAppCustomizer_ located in site or site collection _https://contoso.sharepoint.com/sites/test_. Skips the confirmation prompt message. ```sh -m365 spo customaction remove --title "YourAppCustomizer" --webUrl https://contoso.sharepoint.com/sites/test --confirm +m365 spo customaction remove --title "YourAppCustomizer" --webUrl https://contoso.sharepoint.com/sites/test --force ``` Removes user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site collection _https://contoso.sharepoint.com/sites/test_ diff --git a/docs/docs/cmd/spo/eventreceiver/eventreceiver-remove.mdx b/docs/docs/cmd/spo/eventreceiver/eventreceiver-remove.mdx index 3a9702e0e82..66eeb282307 100644 --- a/docs/docs/cmd/spo/eventreceiver/eventreceiver-remove.mdx +++ b/docs/docs/cmd/spo/eventreceiver/eventreceiver-remove.mdx @@ -34,7 +34,7 @@ m365 spo eventreceiver remove [options] `-s, --scope [scope]` : The scope. Can be either "site" or "web". Defaults to "web". Only applicable when not specifying any of the list properties. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/spo/externaluser/externaluser-list.mdx b/docs/docs/cmd/spo/externaluser/externaluser-list.mdx index 515aec574d9..7bd9d4a494e 100644 --- a/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +++ b/docs/docs/cmd/spo/externaluser/externaluser-list.mdx @@ -13,7 +13,7 @@ m365 spo externaluser list [options] ## Options ```md definition-list -`-f, --filter [filter]` +`--filter [filter]` : Limits the results to only those users whose first name, last name or email address begins with the text in the string, using a case-insensitive comparison `-p, --pageSize [pageSize]` diff --git a/docs/docs/cmd/spo/field/field-remove.mdx b/docs/docs/cmd/spo/field/field-remove.mdx index b6d93d338f6..c992f0d7abf 100644 --- a/docs/docs/cmd/spo/field/field-remove.mdx +++ b/docs/docs/cmd/spo/field/field-remove.mdx @@ -34,7 +34,7 @@ m365 spo field remove [options] `-g, --group [group]` : Delete all fields from this group (case-sensitive). Specify id, title, or group -`--confirm` +`-f, --force` : Don't prompt for confirming removing the field ``` diff --git a/docs/docs/cmd/spo/file/file-add.mdx b/docs/docs/cmd/spo/file/file-add.mdx index ec0c35edd2c..2d9d462d74c 100644 --- a/docs/docs/cmd/spo/file/file-add.mdx +++ b/docs/docs/cmd/spo/file/file-add.mdx @@ -16,7 +16,7 @@ m365 spo file add [options] `-u, --webUrl ` : The URL of the site where the file should be uploaded to -`-f, --folder ` +`--folder ` : The server- or site-relative URL to the folder where the file should be uploaded `-p, --path ` diff --git a/docs/docs/cmd/spo/file/file-checkin.mdx b/docs/docs/cmd/spo/file/file-checkin.mdx index 80360c423c3..a942b0806f2 100644 --- a/docs/docs/cmd/spo/file/file-checkin.mdx +++ b/docs/docs/cmd/spo/file/file-checkin.mdx @@ -16,7 +16,7 @@ m365 spo file checkin [options] `-u, --webUrl ` : The URL of the site where the file is located -`-f, --url [url]` +`--url [url]` : The server- or site-relative URL of the file to retrieve. Specify either `url` or `id` but not both `-i, --id [id]` diff --git a/docs/docs/cmd/spo/file/file-checkout-undo.mdx b/docs/docs/cmd/spo/file/file-checkout-undo.mdx index 2f28660e132..f00e44b51e5 100644 --- a/docs/docs/cmd/spo/file/file-checkout-undo.mdx +++ b/docs/docs/cmd/spo/file/file-checkout-undo.mdx @@ -16,13 +16,13 @@ m365 spo file checkout undo [options] `-u, --webUrl ` : The URL of the site where the file is located. -`-f, --fileUrl [fileUrl]` +`--fileUrl [fileUrl]` : The server- or site-relative URL of the file to retrieve. Specify either `fileUrl` or `fileId` but not both. `-i, --fileId [fileId]` : The UniqueId (GUID) of the file to retrieve. Specify either `fileUrl` or `fileId` but not both. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -47,7 +47,7 @@ m365 spo file checkout undo --webUrl https://contoso.sharepoint.com/sites/projec Discards a checked-out file with a specific URL without prompting for confirmation. ```sh -m365 spo file checkout undo --webUrl https://contoso.sharepoint.com/sites/project-x --fileUrl '/sites/project-x/documents/Test1.docx' --confirm +m365 spo file checkout undo --webUrl https://contoso.sharepoint.com/sites/project-x --fileUrl '/sites/project-x/documents/Test1.docx' --force ``` ## Response diff --git a/docs/docs/cmd/spo/file/file-checkout.mdx b/docs/docs/cmd/spo/file/file-checkout.mdx index 5ec1979a157..2251bb75226 100644 --- a/docs/docs/cmd/spo/file/file-checkout.mdx +++ b/docs/docs/cmd/spo/file/file-checkout.mdx @@ -16,7 +16,7 @@ m365 spo file checkout [options] `-u, --webUrl ` : The URL of the site where the file is located -`-f, --url [url]` +`--url [url]` : The server- or site-relative URL of the file to retrieve. Specify either `url` or `id` but not both `-i, --id [id]` diff --git a/docs/docs/cmd/spo/file/file-list.mdx b/docs/docs/cmd/spo/file/file-list.mdx index fd0f737ee52..1bb78c277ec 100644 --- a/docs/docs/cmd/spo/file/file-list.mdx +++ b/docs/docs/cmd/spo/file/file-list.mdx @@ -18,10 +18,10 @@ m365 spo file list [options] `-u, --webUrl ` : The URL of the site where the folder from which to retrieve files is located -`-f, --folderUrl ` +`--folderUrl ` : The server- or site-relative URL of the parent folder from which to retrieve files -`-f, --folder ` +`--folder ` : (deprecated. Use `folderUrl` instead) The server- or site-relative URL of the folder from which to retrieve files `--fields [fields]` diff --git a/docs/docs/cmd/spo/file/file-remove.mdx b/docs/docs/cmd/spo/file/file-remove.mdx index eb3783f0957..8fbb4c1a19b 100644 --- a/docs/docs/cmd/spo/file/file-remove.mdx +++ b/docs/docs/cmd/spo/file/file-remove.mdx @@ -31,7 +31,7 @@ m365 spo page template remove `--recycle` : Recycle the file instead of actually deleting it -`--confirm` +`-f, --force` : Don't prompt for confirming removing the file ``` diff --git a/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx b/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx index 056779d591b..eb00780f346 100644 --- a/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +++ b/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx @@ -22,7 +22,7 @@ m365 spo file retentionlabel remove [options] `-i, --fileId [fileId]` : The UniqueId (GUID) of the file of which the label should be removed. Specify either `fileUrl` or `fileId` but not both. -`--confirm` +`-f, --force` : Don't prompt for confirming removing the retention label from a file ``` diff --git a/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx b/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx index b9d91a91556..325563493fd 100644 --- a/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +++ b/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx @@ -31,7 +31,7 @@ m365 spo file roleassignment remove [options] `--groupName [groupName]` : The group name of an Azure AD or SharePoint group. Specify either `upn`, `groupName`, or `principalId` but not multiple. -`--confirm [confirm]` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx b/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx index df2c0c32552..11c806f30ee 100644 --- a/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +++ b/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx @@ -25,7 +25,7 @@ m365 spo file roleinheritance break [options] `-c, --clearExistingPermissions` : Clear all existing permissions from the file -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` diff --git a/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx b/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx index 1fa9c856693..421700622d4 100644 --- a/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +++ b/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx @@ -22,7 +22,7 @@ m365 spo file roleinheritance reset [options] `i, --fileId [fileId]` : The UniqueId (GUID) of the file to retrieve. Specify either `fileUrl` or `fileId` but not both -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -39,5 +39,5 @@ m365 spo file roleinheritance reset --webUrl "https://contoso.sharepoint.com/sit Reset inheritance of file with server-relative url _/sites/project-x/documents/Test1_.docx located in site _https://contoso.sharepoint.com/sites/project-x_. It will **not** prompt for confirmation before resetting. ```sh -m365 spo file roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileUrl "/sites/project-x/documents/Test1.docx" --confirm +m365 spo file roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --fileUrl "/sites/project-x/documents/Test1.docx" --force ``` diff --git a/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx b/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx index c00150a6ea3..0741c300b46 100644 --- a/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +++ b/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx @@ -16,7 +16,7 @@ m365 spo file sharinginfo get [options] `-u, --webUrl ` : The URL of the site where the file is located -`-f, --fileUrl [fileUrl]` +`--fileUrl [fileUrl]` : The server- or site-relative URL of the file for which to build the report. Specify either `fileUrl` or `fileId` but not both `-i, --fileId [fileId]` diff --git a/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx b/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx index 548883ad150..d89393b8504 100644 --- a/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +++ b/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx @@ -25,7 +25,7 @@ m365 spo file sharinglink clear [options] `-s, --scope [scope]` : Scope of the sharing link. Possible options are: `anonymous`, `users` or `organization`. If not specified, all links will be removed. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -36,7 +36,7 @@ m365 spo file sharinglink clear [options] Removes all sharing links from a file specified by id without prompting for confirmation ```sh -m365 spo file sharinglink clear --webUrl https://contoso.sharepoint.com/sites/demo --fileId daebb04b-a773-4baa-b1d1-3625418e3234 --confirm +m365 spo file sharinglink clear --webUrl https://contoso.sharepoint.com/sites/demo --fileId daebb04b-a773-4baa-b1d1-3625418e3234 --force ``` Removes sharing links of type anonymous from a file specified by url with prompting for confirmation diff --git a/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx b/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx index 464691e5fc3..3822509eff2 100644 --- a/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +++ b/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx @@ -25,7 +25,7 @@ m365 spo file sharinglink remove [options] `-i, --id ` : The ID of the sharing link. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -36,7 +36,7 @@ m365 spo file sharinglink remove [options] Removes a specific sharing link from a file by id without prompting for confirmation. ```sh -m365 spo file sharinglink remove --webUrl https://contoso.sharepoint.com/sites/demo --fileId daebb04b-a773-4baa-b1d1-3625418e3234 --id c391b57d-5783-4c53-9236-cefb5c6ef323 --confirm +m365 spo file sharinglink remove --webUrl https://contoso.sharepoint.com/sites/demo --fileId daebb04b-a773-4baa-b1d1-3625418e3234 --id c391b57d-5783-4c53-9236-cefb5c6ef323 --force ``` Removes a specific sharing link from a file by a specified site-relative URL. diff --git a/docs/docs/cmd/spo/file/file-version-clear.mdx b/docs/docs/cmd/spo/file/file-version-clear.mdx index 7a9e23cd938..bda2552667c 100644 --- a/docs/docs/cmd/spo/file/file-version-clear.mdx +++ b/docs/docs/cmd/spo/file/file-version-clear.mdx @@ -22,7 +22,7 @@ m365 spo file version clear [options] `-i, --fileId [fileId]` : The UniqueId (GUID) of the file. Specify either `fileUrl` or `fileId` but not both -`--confirm [confirm]` +`-f, --force` : Don't prompt for confirmation. ``` @@ -45,13 +45,13 @@ m365 spo file version clear --webUrl https://contoso.sharepoint.com --fileUrl '/ Removes all file version history in a specific site based on fileId without prompting for confirmation ```sh -m365 spo file version clear --webUrl https://contoso.sharepoint.com --fileId 'b2307a39-e878-458b-bc90-03bc578531d6' --confirm +m365 spo file version clear --webUrl https://contoso.sharepoint.com --fileId 'b2307a39-e878-458b-bc90-03bc578531d6' --force ``` Removes all file version history in a specific site based on fileUrl without prompting for confirmation ```sh -m365 spo file version clear --webUrl https://contoso.sharepoint.com --fileUrl '/Shared Documents/Document.docx' --confirm +m365 spo file version clear --webUrl https://contoso.sharepoint.com --fileUrl '/Shared Documents/Document.docx' --force ``` ## Response diff --git a/docs/docs/cmd/spo/file/file-version-remove.mdx b/docs/docs/cmd/spo/file/file-version-remove.mdx index 47fce65ef25..5a564e472aa 100644 --- a/docs/docs/cmd/spo/file/file-version-remove.mdx +++ b/docs/docs/cmd/spo/file/file-version-remove.mdx @@ -25,7 +25,7 @@ m365 spo file version remove [options] `-i, --fileId [fileId]` : The UniqueId (GUID) of the file to retrieve. Specify either `fileUrl` or `fileId` but not both -`--confirm [confirm]` +`-f, --force` : Don't prompt for confirmation. ``` @@ -48,13 +48,13 @@ m365 spo file version remove --webUrl https://contoso.sharepoint.com --label "1. Removes a file version in a specific site based on fileId without prompting for confirmation ```sh -m365 spo file version remove --webUrl https://contoso.sharepoint.com --label "1.0" --fileId 'b2307a39-e878-458b-bc90-03bc578531d6' --confirm +m365 spo file version remove --webUrl https://contoso.sharepoint.com --label "1.0" --fileId 'b2307a39-e878-458b-bc90-03bc578531d6' --force ``` Removes a file version in a specific site based on fileUrl without prompting for confirmation ```sh -m365 spo file version remove --webUrl https://contoso.sharepoint.com --label "1.0" --fileUrl '/Shared Documents/Document.docx' --confirm +m365 spo file version remove --webUrl https://contoso.sharepoint.com --label "1.0" --fileUrl '/Shared Documents/Document.docx' --force ``` ## Response diff --git a/docs/docs/cmd/spo/file/file-version-restore.mdx b/docs/docs/cmd/spo/file/file-version-restore.mdx index 0e6dca1fea9..7a5c54c3b6d 100644 --- a/docs/docs/cmd/spo/file/file-version-restore.mdx +++ b/docs/docs/cmd/spo/file/file-version-restore.mdx @@ -25,7 +25,7 @@ m365 spo file version restore [options] `-i, --fileId [fileId]` : The UniqueId (GUID) of the file whose version will be restored. Specify either `fileUrl` or `fileId` but not both -`--confirm [confirm]` +`-f, --force` : Don't prompt for confirmation. ``` @@ -48,13 +48,13 @@ m365 spo file version restore --webUrl https://contoso.sharepoint.com --label "1 Restores a file version in a specific site based on fileId without prompting for confirmation ```sh -m365 spo file version restore --webUrl https://contoso.sharepoint.com --label "1.0" --fileId 'b2307a39-e878-458b-bc90-03bc578531d6' --confirm +m365 spo file version restore --webUrl https://contoso.sharepoint.com --label "1.0" --fileId 'b2307a39-e878-458b-bc90-03bc578531d6' --force ``` Restores a file version in a specific site based on fileUrl without prompting for confirmation ```sh -m365 spo file version restore --webUrl https://contoso.sharepoint.com --label "1.0" --fileUrl '/Shared Documents/Document.docx' --confirm +m365 spo file version restore --webUrl https://contoso.sharepoint.com --label "1.0" --fileUrl '/Shared Documents/Document.docx' --force ``` ## Response diff --git a/docs/docs/cmd/spo/folder/folder-get.mdx b/docs/docs/cmd/spo/folder/folder-get.mdx index 7dd9def5a01..a9162686f55 100644 --- a/docs/docs/cmd/spo/folder/folder-get.mdx +++ b/docs/docs/cmd/spo/folder/folder-get.mdx @@ -16,7 +16,7 @@ m365 spo folder get [options] `-u, --webUrl ` : The URL of the site where the folder is located. -`-f, --url [url]` +`--url [url]` : The server- or site-relative URL of the folder to retrieve. Specify either `folderUrl` or `id` but not both. `-i, --id [id]` diff --git a/docs/docs/cmd/spo/folder/folder-list.mdx b/docs/docs/cmd/spo/folder/folder-list.mdx index c707aacf658..f4b79eed177 100644 --- a/docs/docs/cmd/spo/folder/folder-list.mdx +++ b/docs/docs/cmd/spo/folder/folder-list.mdx @@ -21,7 +21,7 @@ m365 spo folder list [options] `-p, --parentFolderUrl ` : The server- or site-relative URL of the parent folder. -`-f, --fields [fields]` +`--fields [fields]` : Comma-separated list of fields to retrieve. Will retrieve all fields if not specified and json output is requested. `--filter [filter]` diff --git a/docs/docs/cmd/spo/folder/folder-remove.mdx b/docs/docs/cmd/spo/folder/folder-remove.mdx index 0bf32f7c491..85394cc4c10 100644 --- a/docs/docs/cmd/spo/folder/folder-remove.mdx +++ b/docs/docs/cmd/spo/folder/folder-remove.mdx @@ -16,13 +16,13 @@ m365 spo folder remove [options] `-u, --webUrl ` : The URL of the site where the folder to be deleted is located. -`-f, --url ` +`--url ` : The server- or site-relative URL of the folder to delete. `--recycle` : Recycles the folder instead of actually deleting it. -`--confirm` +`-f, --force` : Don't prompt for confirming deleting the folder. ``` diff --git a/docs/docs/cmd/spo/folder/folder-rename.mdx b/docs/docs/cmd/spo/folder/folder-rename.mdx index 3a4b488f8ad..869df2309c8 100644 --- a/docs/docs/cmd/spo/folder/folder-rename.mdx +++ b/docs/docs/cmd/spo/folder/folder-rename.mdx @@ -16,7 +16,7 @@ m365 spo folder rename [options] `-u, --webUrl ` : The URL of the site where the folder to be renamed is located. -`-f, --url ` +`--url ` : The server- or site-relative URL of the folder (including the folder). `-n, --name ` diff --git a/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx b/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx index 4114bb706e3..2bb89725627 100644 --- a/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +++ b/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx @@ -22,7 +22,7 @@ m365 spo folder retentionlabel remove [options] `-i, --folderId [folderId]` : The UniqueId (GUID) of the folder of which the label should be removed. Specify either `folderUrl` or `folderId` but not both. -`--confirm` +`-f, --force` : Don't prompt for confirming to remove the label. ``` diff --git a/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx b/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx index f287d4f373a..61faf58bfe9 100644 --- a/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx +++ b/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx @@ -16,7 +16,7 @@ m365 spo folder roleassignment add [options] `-u, --webUrl ` : The URL of the site where the folder is located. -`-f, --folderUrl ` +`--folderUrl ` : The server- or site-relative URL of the folder. `--principalId [principalId]` diff --git a/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx b/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx index c1a559ad323..7d81bac9faa 100644 --- a/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx +++ b/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx @@ -16,7 +16,7 @@ m365 spo folder roleassignment remove [options] `-u, --webUrl ` : The URL of the site where the folder is located. -`-f, --folderUrl ` +`--folderUrl ` : The server- or site-relative URL of the folder. `--principalId [principalId]` @@ -28,7 +28,7 @@ m365 spo folder roleassignment remove [options] `--groupName [groupName]` : The Azure AD or SharePoint group name. Specify either upn, groupName or principalId but not multiple. -`--confirm` +`-f, --force` : Don't prompt for confirmation when removing the role assignment. ``` @@ -51,7 +51,7 @@ m365 spo folder roleassignment remove --webUrl "https://contoso.sharepoint.com/s Remove the role assignment from the specified folder based on the principal id without prompting for removal confirmation. ```sh -m365 spo folder roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --folderUrl "/Shared Documents/FolderPermission" --principalId 2 --confirm +m365 spo folder roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --folderUrl "/Shared Documents/FolderPermission" --principalId 2 --force ``` Remove the role assignment from the specified folder based on the upn. diff --git a/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx b/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx index 33978da7ac9..f8b7dfcd29e 100644 --- a/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx +++ b/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx @@ -16,13 +16,13 @@ m365 spo folder roleinheritance break [options] `-u, --webUrl ` : URL of the site where the folder is located. -`-f, --folderUrl ` +`--folderUrl ` : The server- or site-relative URL of the folder. `-c, --clearExistingPermissions` : Clear all existing permissions from the folder. -`--confirm` +`-f, --force` : Don't prompt for confirmation to breaking role inheritance of the folder. ``` @@ -39,11 +39,11 @@ m365 spo folder roleinheritance break --webUrl "https://contoso.sharepoint.com/s Break the inheritance of a folder with a specified server-relative URL. It will clear the existing permissions of the folder. It will **not** prompt for confirmation before breaking the inheritance. ```sh -m365 spo folder roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/sites/project-x/Shared Documents/TestFolder" --clearExistingPermissions --confirm +m365 spo folder roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/sites/project-x/Shared Documents/TestFolder" --clearExistingPermissions --force ``` Break the inheritance of the specified root folder for the library with a specified server-relative URL. It will clear the existing permissions of the root folder. It will **not** prompt for confirmation before breaking the inheritance. ```sh -m365 spo folder roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/sites/project-x/Shared Documents" --clearExistingPermissions --confirm +m365 spo folder roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/sites/project-x/Shared Documents" --clearExistingPermissions --force ``` diff --git a/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx b/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx index a690f2ecfb9..c4831d85dee 100644 --- a/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx +++ b/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx @@ -16,10 +16,10 @@ m365 spo folder roleinheritance reset [options] `-u, --webUrl ` : URL of the site where the folder is located. -`-f, --folderUrl ` +`--folderUrl ` : The server- or site-relative URL of the folder. -`--confirm` +`-f, --force` : Don't prompt for confirmation to reset role inheritance of the folder. ``` @@ -36,11 +36,11 @@ m365 spo folder roleinheritance reset --webUrl "https://contoso.sharepoint.com/s Reset inheritance of folder with a specific server-relative URL. It will **not** prompt for confirmation before resetting. ```sh -m365 spo folder roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/sites/project-x/Shared Documents/TestFolder" --confirm +m365 spo folder roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/sites/project-x/Shared Documents/TestFolder" --force ``` Reset inheritance of the specified root folder for the library with a specific server-relative URL. It will **not** prompt for confirmation before resetting. ```sh -m365 spo folder roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/sites/project-x/Shared Documents" --confirm +m365 spo folder roleinheritance reset --webUrl "https://contoso.sharepoint.com/sites/project-x" --folderUrl "/sites/project-x/Shared Documents" --force ``` diff --git a/docs/docs/cmd/spo/group/group-remove.mdx b/docs/docs/cmd/spo/group/group-remove.mdx index 849591dcca5..0f31cf02cc8 100644 --- a/docs/docs/cmd/spo/group/group-remove.mdx +++ b/docs/docs/cmd/spo/group/group-remove.mdx @@ -22,7 +22,7 @@ m365 spo group remove [options] `--name [name]` : Name of the group to remove. Use ID or name but not both -`--confirm` +`-f, --force` : Confirm removal of the group ``` diff --git a/docs/docs/cmd/spo/homesite/homesite-remove.mdx b/docs/docs/cmd/spo/homesite/homesite-remove.mdx index d036c320559..580e0f4fd69 100644 --- a/docs/docs/cmd/spo/homesite/homesite-remove.mdx +++ b/docs/docs/cmd/spo/homesite/homesite-remove.mdx @@ -15,7 +15,7 @@ m365 spo homesite remove [options] ## Options ```md definition-list -`--confirm` +`-f, --force` : Do not prompt for confirmation before removing the Home Site. ``` @@ -34,7 +34,7 @@ To use this command you have to have permissions to access the tenant admin site Removes the current Home Site without confirmation. ```sh -m365 spo homesite remove --confirm +m365 spo homesite remove --force ``` ## Response diff --git a/docs/docs/cmd/spo/hubsite/hubsite-data-get.mdx b/docs/docs/cmd/spo/hubsite/hubsite-data-get.mdx index 8ef0c44db10..adda118c10b 100644 --- a/docs/docs/cmd/spo/hubsite/hubsite-data-get.mdx +++ b/docs/docs/cmd/spo/hubsite/hubsite-data-get.mdx @@ -18,7 +18,7 @@ m365 spo hubsite data get [options] `-u, --webUrl ` : URL of the site for which to retrieve hub site data. -`-f, --forceRefresh` +`--forceRefresh` : Set, to refresh the server cache with the latest updates. ``` @@ -26,7 +26,7 @@ m365 spo hubsite data get [options] ## Remarks -By default, the hub site data is returned from the server's cache. To refresh the data with the latest updates, use the `-f, --forceRefresh` option. Use this option, if you just made changes and need to see them right away. +By default, the hub site data is returned from the server's cache. To refresh the data with the latest updates, use the `--forceRefresh` option. Use this option, if you just made changes and need to see them right away. If the specified site is not connected to a hub site site and is not a hub site itself, no data will be retrieved. diff --git a/docs/docs/cmd/spo/hubsite/hubsite-disconnect.mdx b/docs/docs/cmd/spo/hubsite/hubsite-disconnect.mdx index ff2136984d3..e17f6f24ce0 100644 --- a/docs/docs/cmd/spo/hubsite/hubsite-disconnect.mdx +++ b/docs/docs/cmd/spo/hubsite/hubsite-disconnect.mdx @@ -22,7 +22,7 @@ m365 spo hubsite disconnect [options] `-u, --url [url]` : Absolute or server-relative URL of the hub site. Specify either `id`, `title`, or `url` but not multiple. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.mdx b/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.mdx index 2562deb82ca..7769f59d9e2 100644 --- a/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.mdx +++ b/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.mdx @@ -19,7 +19,7 @@ m365 spo hubsite rights revoke [options] `-p, --principals ` : Comma-separated list of principals to revoke join rights. Principals can be users or mail-enabled security groups in the form of `alias` or `alias@.com`. -`--confirm` +`-f, --force` : Don't prompt for confirming revoking rights ``` @@ -44,7 +44,7 @@ m365 spo hubsite rights revoke --hubSiteUrl https://contoso.sharepoint.com/sites Revoke rights to join sites to the hub site with specific URL. from user with specific aliases without prompting for confirmation. ```sh -m365 spo hubsite rights revoke --hubSiteUrl https://contoso.sharepoint.com/sites/sales --principals "PattiF,AdeleV" --confirm +m365 spo hubsite rights revoke --hubSiteUrl https://contoso.sharepoint.com/sites/sales --principals "PattiF,AdeleV" --force ``` ## Response diff --git a/docs/docs/cmd/spo/hubsite/hubsite-unregister.mdx b/docs/docs/cmd/spo/hubsite/hubsite-unregister.mdx index 28c61746c5e..f216ab31a9b 100644 --- a/docs/docs/cmd/spo/hubsite/hubsite-unregister.mdx +++ b/docs/docs/cmd/spo/hubsite/hubsite-unregister.mdx @@ -16,7 +16,7 @@ m365 spo hubsite unregister [options] `-u, --url ` : URL of the site collection. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -43,7 +43,7 @@ m365 spo hubsite unregister --url https://contoso.sharepoint.com/sites/sales Unregister the site collection with specific URL. as a hub site without prompting for confirmation. ```sh -m365 spo hubsite unregister --url https://contoso.sharepoint.com/sites/sales --confirm +m365 spo hubsite unregister --url https://contoso.sharepoint.com/sites/sales --force ``` ## Response diff --git a/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.mdx b/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.mdx index 047bb177317..3387d4dda4c 100644 --- a/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.mdx +++ b/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.mdx @@ -15,7 +15,7 @@ m365 spo knowledgehub remove [options] ## Options ```md definition-list -`--confirm` +`-f, --force` : Do not prompt for confirmation before removing the Knowledge Hub Site setting for your tenant. ``` @@ -40,7 +40,7 @@ m365 spo knowledgehub remove Removes the Knowledge Hub Site setting for your tenant without confirmation. ```sh -m365 spo knowledgehub remove --confirm +m365 spo knowledgehub remove --force ``` ## Response diff --git a/docs/docs/cmd/spo/list/list-contenttype-remove.mdx b/docs/docs/cmd/spo/list/list-contenttype-remove.mdx index c58e655c154..7a377de1097 100644 --- a/docs/docs/cmd/spo/list/list-contenttype-remove.mdx +++ b/docs/docs/cmd/spo/list/list-contenttype-remove.mdx @@ -28,7 +28,7 @@ m365 spo list contenttype remove [options] `-i, --id ` : ID of the content type to remove from the list. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -51,7 +51,7 @@ m365 spo list contenttype remove --webUrl https://contoso.sharepoint.com/sites/p Remove content type with a specific id from the list retrieved by server relative URL in a specific site. This will not prompt for confirmation. ```sh -m365 spo list contenttype remove --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl 'sites/project-x/Documents' --contentTypeId 0x010109010053EE7AEB1FC54A41B4D9F66ADBDC312A --confirm +m365 spo list contenttype remove --webUrl https://contoso.sharepoint.com/sites/project-x --listUrl 'sites/project-x/Documents' --contentTypeId 0x010109010053EE7AEB1FC54A41B4D9F66ADBDC312A --force ``` ## Response diff --git a/docs/docs/cmd/spo/list/list-list.mdx b/docs/docs/cmd/spo/list/list-list.mdx index f4d059f64e0..36926b302bf 100644 --- a/docs/docs/cmd/spo/list/list-list.mdx +++ b/docs/docs/cmd/spo/list/list-list.mdx @@ -21,7 +21,7 @@ m365 spo list list [options] `-p, --properties [properties]` : Comma-separated list of properties to retrieve. Will retrieve all properties if not specified. -`-f, --filter [filter]` +`--filter [filter]` : OData filter to use to query the lists with. ``` diff --git a/docs/docs/cmd/spo/list/list-remove.mdx b/docs/docs/cmd/spo/list/list-remove.mdx index a76d5187e8e..a0f6b2336c4 100644 --- a/docs/docs/cmd/spo/list/list-remove.mdx +++ b/docs/docs/cmd/spo/list/list-remove.mdx @@ -22,7 +22,7 @@ m365 spo list remove [options] `-t, --title [title]` : Title of the list to remove. Specify either `id` or `title` but not both. -`--confirm` +`-f, --force` : Don't prompt for confirming removing the list. ``` diff --git a/docs/docs/cmd/spo/list/list-retentionlabel-remove.mdx b/docs/docs/cmd/spo/list/list-retentionlabel-remove.mdx index a48817b45e7..f05a128c6c5 100644 --- a/docs/docs/cmd/spo/list/list-retentionlabel-remove.mdx +++ b/docs/docs/cmd/spo/list/list-retentionlabel-remove.mdx @@ -25,7 +25,7 @@ m365 spo list retentionlabel remove [options] `-l, --listUrl [listUrl]` : Server- or web-relative URL of the list on which to remove the label. Specify either `listTitle`, `listId`, or `listUrl` but not multiple. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -48,7 +48,7 @@ m365 spo list retentionlabel remove --webUrl https://contoso.sharepoint.com/site Clears the retention label on a given list by ID without confirmation. ```sh -m365 spo list retentionlabel remove --webUrl https://contoso.sharepoint.com/sites/project-x --listId 'Documents' --confirm +m365 spo list retentionlabel remove --webUrl https://contoso.sharepoint.com/sites/project-x --listId 'Documents' --force ``` ## Response diff --git a/docs/docs/cmd/spo/list/list-roleassignment-remove.mdx b/docs/docs/cmd/spo/list/list-roleassignment-remove.mdx index 2d316fec985..8454633c2c9 100644 --- a/docs/docs/cmd/spo/list/list-roleassignment-remove.mdx +++ b/docs/docs/cmd/spo/list/list-roleassignment-remove.mdx @@ -34,7 +34,7 @@ m365 spo list roleassignment remove [options] `--groupName [groupName]` : enter group name of Azure AD or SharePoint group. Specify either `principalId`, `upn`, or `groupName` but not multiple. -`--confirm` +`-f, --force` : Don't prompt for confirming removing the role assignment. ``` diff --git a/docs/docs/cmd/spo/list/list-roleinheritance-break.mdx b/docs/docs/cmd/spo/list/list-roleinheritance-break.mdx index 496c42801be..0c5a31a92c8 100644 --- a/docs/docs/cmd/spo/list/list-roleinheritance-break.mdx +++ b/docs/docs/cmd/spo/list/list-roleinheritance-break.mdx @@ -28,7 +28,7 @@ m365 spo list roleinheritance break [options] `-c, --clearExistingPermissions` : Flag if used clears all roles from the list. -`--confirm` +`-f, --force` : Do not prompt for confirmation before breaking role inheritance. ``` @@ -67,7 +67,7 @@ m365 spo list roleinheritance break --webUrl "https://contoso.sharepoint.com/sit Break inheritance of list by ID located in in a specific site with clearing permissions without prompting for confirmation. ```sh -m365 spo list roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --listId "202b8199-b9de-43fd-9737-7f213f51c991" --clearExistingPermissions --confirm +m365 spo list roleinheritance break --webUrl "https://contoso.sharepoint.com/sites/project-x" --listId "202b8199-b9de-43fd-9737-7f213f51c991" --clearExistingPermissions --force ``` ## Response diff --git a/docs/docs/cmd/spo/list/list-roleinheritance-reset.mdx b/docs/docs/cmd/spo/list/list-roleinheritance-reset.mdx index c22f55780c5..22eaf8a75d0 100644 --- a/docs/docs/cmd/spo/list/list-roleinheritance-reset.mdx +++ b/docs/docs/cmd/spo/list/list-roleinheritance-reset.mdx @@ -25,7 +25,7 @@ m365 spo list roleinheritance reset [options] `--listUrl [listUrl]` : Server- or site-relative URL of the list. Specify either `listTitle`, `listId`, or `listUrl`. -`--confirm` +`-f, --force` : Do not prompt for confirmation before resetting role inheritance. ``` @@ -54,7 +54,7 @@ m365 spo list roleinheritance reset --webUrl https://contoso.sharepoint.com/site Restores role inheritance of list a specific list by title without prompting for confirmation. ```sh -m365 spo list roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle test --confirm +m365 spo list roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle test --force ``` ## Response diff --git a/docs/docs/cmd/spo/list/list-view-remove.mdx b/docs/docs/cmd/spo/list/list-view-remove.mdx index d12ce409d78..0b5d1131a9e 100644 --- a/docs/docs/cmd/spo/list/list-view-remove.mdx +++ b/docs/docs/cmd/spo/list/list-view-remove.mdx @@ -31,7 +31,7 @@ m365 spo list view remove [options] `--title [title]` : Title of the view to remove. Specify either `id` or `title` but not both -`--confirm` +`-f, --force` : Don't prompt for confirming removing the view ``` @@ -66,7 +66,7 @@ m365 spo list view remove --webUrl https://contoso.sharepoint.com/sites/project- Remove view with ID _cc27a922-8224-4296-90a5-ebbc54da2e81_ from a list with title _Documents_ located in site _https://contoso.sharepoint.com/sites/project-x_ without being asked for confirmation ```sh -m365 spo list view remove --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle Documents --id cc27a922-8224-4296-90a5-ebbc54da2e81 --confirm +m365 spo list view remove --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle Documents --id cc27a922-8224-4296-90a5-ebbc54da2e81 --force ``` ## Response diff --git a/docs/docs/cmd/spo/list/list-webhook-remove.mdx b/docs/docs/cmd/spo/list/list-webhook-remove.mdx index 46e19d00b12..a115a82cf4c 100644 --- a/docs/docs/cmd/spo/list/list-webhook-remove.mdx +++ b/docs/docs/cmd/spo/list/list-webhook-remove.mdx @@ -28,7 +28,7 @@ m365 spo list webhook remove [options] `-i, --id ` : ID of the webhook. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -54,7 +54,7 @@ m365 spo list webhook remove --webUrl https://contoso.sharepoint.com/sites/ninja Remove webhook with a specific ID from a list retrieved by URL in a specific site without being asked for confirmation ```sh -m365 spo list webhook remove --webUrl https://contoso.sharepoint.com/sites/ninja --listUrl '/sites/ninja/Documents' --id cc27a922-8224-4296-90a5-ebbc54da2e81 --confirm +m365 spo list webhook remove --webUrl https://contoso.sharepoint.com/sites/ninja --listUrl '/sites/ninja/Documents' --id cc27a922-8224-4296-90a5-ebbc54da2e81 --force ``` ## Response diff --git a/docs/docs/cmd/spo/listitem/listitem-add.mdx b/docs/docs/cmd/spo/listitem/listitem-add.mdx index 1826e915a70..e2cfe8f3fe9 100644 --- a/docs/docs/cmd/spo/listitem/listitem-add.mdx +++ b/docs/docs/cmd/spo/listitem/listitem-add.mdx @@ -30,7 +30,7 @@ m365 spo listitem add [options] `-c, --contentType [contentType]` : The name or the ID of the content type to associate with the new item -`-f, --folder [folder]` +`--folder [folder]` : The list-relative URL of the folder where the item should be created ``` diff --git a/docs/docs/cmd/spo/listitem/listitem-list.mdx b/docs/docs/cmd/spo/listitem/listitem-list.mdx index b66d39db24d..3f48b7a0012 100644 --- a/docs/docs/cmd/spo/listitem/listitem-list.mdx +++ b/docs/docs/cmd/spo/listitem/listitem-list.mdx @@ -30,7 +30,7 @@ m365 spo listitem list [options] `-q, --camlQuery [camlQuery]` : CAML query to use to query the list of items with. -`-f, --fields [fields]` +`--fields [fields]` : Comma-separated list of fields to retrieve. Will retrieve all fields if not specified and json output is requested. Specify `camlQuery` or `fields` but not both. `-l, --filter [filter]` diff --git a/docs/docs/cmd/spo/listitem/listitem-remove.mdx b/docs/docs/cmd/spo/listitem/listitem-remove.mdx index f1e8344f853..24046550fff 100644 --- a/docs/docs/cmd/spo/listitem/listitem-remove.mdx +++ b/docs/docs/cmd/spo/listitem/listitem-remove.mdx @@ -31,7 +31,7 @@ m365 spo listitem remove [options] `--recycle` : Recycle the list item -`--confirm` +`-f, --force` : Don't prompt for confirming removing the list item ``` diff --git a/docs/docs/cmd/spo/listitem/listitem-retentionlabel-remove.mdx b/docs/docs/cmd/spo/listitem/listitem-retentionlabel-remove.mdx index 5313c525105..952655a862c 100644 --- a/docs/docs/cmd/spo/listitem/listitem-retentionlabel-remove.mdx +++ b/docs/docs/cmd/spo/listitem/listitem-retentionlabel-remove.mdx @@ -28,7 +28,7 @@ m365 spo listitem retentionlabel remove [options] `--listUrl [listUrl]` : Server- or site-relative URL of the list. Specify either `listTitle`, `listId` or `listUrl` -`--confirm` +`-f, --force` : Don't prompt for confirming removing the retention label from a list item ``` diff --git a/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.mdx b/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.mdx index 0b6cbaebee7..f8c6f6dcf73 100644 --- a/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.mdx +++ b/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.mdx @@ -37,7 +37,7 @@ m365 spo listitem roleassignment remove [options] `--groupName [groupName]` : enter group name of Azure AD or SharePoint group. Specify either `principalId`, `upn`, or `groupName` but not multiple. -`--confirm` +`-f, --force` : Don't prompt for confirming removing the role assignment. ``` @@ -67,7 +67,7 @@ m365 spo listitem roleassignment remove --webUrl "https://contoso.sharepoint.com Remove roleassignment from listitem getting list by url based on principal Id without prompting for confirmation ```sh -m365 spo listitem roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listUrl '/sites/contoso-sales/lists/Events' --listItemId 1 --principalId 2 --confirm +m365 spo listitem roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --listUrl '/sites/contoso-sales/lists/Events' --listItemId 1 --principalId 2 --force ``` ## Response diff --git a/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.mdx b/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.mdx index 99d1c04500f..dbacc9b4337 100644 --- a/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.mdx +++ b/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.mdx @@ -31,7 +31,7 @@ m365 spo listitem roleinheritance break [options] `-c, --clearExistingPermissions` : Set to clear existing roles from the list item -`--confirm` +`-f, --force` : Do not prompt for confirmation before breaking role inheritance. ``` @@ -70,7 +70,7 @@ m365 spo listitem roleinheritance break --webUrl https://contoso.sharepoint.com/ Break inheritance of list item _1_ in list with ID _202b8199-b9de-43fd-9737-7f213f51c991_ located in site _https://contoso.sharepoint.com/sites/project-x_ with clearing permissions without prompting for confirmation ```sh -m365 spo listitem roleinheritance break --webUrl https://contoso.sharepoint.com/sites/project-x --listId 202b8199-b9de-43fd-9737-7f213f51c991 --listItemId 1 --clearExistingPermissions --confirm +m365 spo listitem roleinheritance break --webUrl https://contoso.sharepoint.com/sites/project-x --listId 202b8199-b9de-43fd-9737-7f213f51c991 --listItemId 1 --clearExistingPermissions --force ``` ## Response diff --git a/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.mdx b/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.mdx index 8f653a46563..de1b279a264 100644 --- a/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.mdx +++ b/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.mdx @@ -28,7 +28,7 @@ m365 spo listitem roleinheritance reset [options] `--listUrl [listUrl]` : Server- or site-relative URL of the list. Specify either `listTitle`, `listId` or `listUrl` -`--confirm` +`-f, --force` : Do not prompt for confirmation before resetting role inheritance. ``` @@ -51,7 +51,7 @@ m365 spo listitem roleinheritance reset --webUrl https://contoso.sharepoint.com/ Restore role inheritance of a list item with a specific id in a list retrieved by server relative URL located in a specific site without prompting for confirmation ```sh -m365 spo listitem roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --listItemId 8 --listUrl /sites/project-x/lists/test --confirm +m365 spo listitem roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --listItemId 8 --listUrl /sites/project-x/lists/test --force ``` ## Response diff --git a/docs/docs/cmd/spo/navigation/navigation-node-remove.mdx b/docs/docs/cmd/spo/navigation/navigation-node-remove.mdx index fe2a3909817..fe6b41e51d4 100644 --- a/docs/docs/cmd/spo/navigation/navigation-node-remove.mdx +++ b/docs/docs/cmd/spo/navigation/navigation-node-remove.mdx @@ -22,7 +22,7 @@ m365 spo navigation node remove [options] `-i, --id ` : ID of the node to remove -`--confirm` +`-f, --force` : Don't prompt for confirming removing the node ``` @@ -39,7 +39,7 @@ m365 spo navigation node remove --webUrl https://contoso.sharepoint.com/sites/te Remove a node from the quick launch without prompting for confirmation ```sh -m365 spo navigation node remove --webUrl https://contoso.sharepoint.com/sites/team-a --location QuickLaunch --id 2003 --confirm +m365 spo navigation node remove --webUrl https://contoso.sharepoint.com/sites/team-a --location QuickLaunch --id 2003 --force ``` ## Response diff --git a/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.mdx b/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.mdx index 2bbb7d89663..e74675e588c 100644 --- a/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.mdx +++ b/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.mdx @@ -18,7 +18,7 @@ m365 spo orgassetslibrary remove [options] `--libraryUrl ` : The server relative URL of the library to be removed as a central location for organization assets. -`--confirm` +`-f, --force` : Don't prompt for confirming removing the organization asset library. ``` @@ -37,7 +37,7 @@ To use this command you have to have permissions to access the tenant admin site Removes organization assets library without prompting for confirmation ```sh -m365 spo orgassetslibrary remove --libraryUrl "/sites/branding/assets" --confirm +m365 spo orgassetslibrary remove --libraryUrl "/sites/branding/assets" --force ``` ## Response @@ -69,7 +69,7 @@ m365 spo orgassetslibrary remove --libraryUrl "/sites/branding/assets" --confirm ```md - # spo orgassetslibrary remove --libraryUrl "https://contoso.sharepoint.com/sites/branding/SiteAssets" --confirm "true" + # spo orgassetslibrary remove --libraryUrl "https://contoso.sharepoint.com/sites/branding/SiteAssets" --force Date: 5/1/2023 diff --git a/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.mdx b/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.mdx index 5f3faa2c39e..c89a3b4661c 100644 --- a/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.mdx +++ b/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.mdx @@ -16,7 +16,7 @@ m365 spo orgnewssite remove [options] `-u, --url ` : Absolute URL of the site to remove. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -41,7 +41,7 @@ m365 spo orgnewssite remove --url https://contoso.sharepoint.com/sites/site1 Remove a site from the list of organizational news sites, without prompting for confirmation ```sh -m365 spo orgnewssite remove --url https://contoso.sharepoint.com/sites/site1 --confirm +m365 spo orgnewssite remove --url https://contoso.sharepoint.com/sites/site1 --force ``` ## Response diff --git a/docs/docs/cmd/spo/page/page-remove.mdx b/docs/docs/cmd/spo/page/page-remove.mdx index 9412a605c9a..7603f9405f8 100644 --- a/docs/docs/cmd/spo/page/page-remove.mdx +++ b/docs/docs/cmd/spo/page/page-remove.mdx @@ -19,7 +19,7 @@ m365 spo page remove [options] `-u, --webUrl ` : URL of the site from which the page should be removed. -`--confirm` +`-f, --force` : Do not prompt for confirmation before removing the page. ``` @@ -29,7 +29,7 @@ m365 spo page remove [options] If you try to remove a page with that does not exist, you will get a `The file does not exist` error. -If you set the `--confirm` flag, you will not be prompted for confirmation before the page is actually removed. +If you set the `-f, --force` flag, you will not be prompted for confirmation before the page is actually removed. ## Examples @@ -42,7 +42,7 @@ m365 spo page remove --name page.aspx --webUrl https://contoso.sharepoint.com/si Remove a modern page without a confirmation prompt ```sh -m365 spo page remove --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --confirm +m365 spo page remove --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --force ``` ## Response diff --git a/docs/docs/cmd/spo/propertybag/propertybag-get.mdx b/docs/docs/cmd/spo/propertybag/propertybag-get.mdx index 26dd8f3d713..8c519f57886 100644 --- a/docs/docs/cmd/spo/propertybag/propertybag-get.mdx +++ b/docs/docs/cmd/spo/propertybag/propertybag-get.mdx @@ -21,7 +21,7 @@ m365 spo propertybag get [options] `-k, --key ` : Key of the property for which the value should be retrieved. Case-sensitive. -`-f, --folder [folder]` +`--folder [folder]` : Site-relative URL of the folder from which to retrieve property bag value. Case-sensitive. ``` diff --git a/docs/docs/cmd/spo/propertybag/propertybag-list.mdx b/docs/docs/cmd/spo/propertybag/propertybag-list.mdx index e4ecbedc58c..42e8cc25729 100644 --- a/docs/docs/cmd/spo/propertybag/propertybag-list.mdx +++ b/docs/docs/cmd/spo/propertybag/propertybag-list.mdx @@ -18,7 +18,7 @@ m365 spo propertybag list [options] `-u, --webUrl ` : The URL of the site from which the property bag value should be retrieved. -`-f, --folder [folder]` +`--folder [folder]` : Site-relative URL of the folder from which to retrieve property bag value. Case-sensitive. ``` diff --git a/docs/docs/cmd/spo/propertybag/propertybag-remove.mdx b/docs/docs/cmd/spo/propertybag/propertybag-remove.mdx index adae77bf271..c7c96782f0b 100644 --- a/docs/docs/cmd/spo/propertybag/propertybag-remove.mdx +++ b/docs/docs/cmd/spo/propertybag/propertybag-remove.mdx @@ -19,10 +19,10 @@ m365 spo propertybag remove [options] `-k, --key ` : Key of the property to be removed. Case-sensitive. -`-f, --folder [folder]` +`--folder [folder]` : Site-relative URL of the folder from which to remove the property bag value. -`--confirm` +`-f, --force` : Don't prompt for confirming removal of property bag value. ``` @@ -39,7 +39,7 @@ m365 spo propertybag remove --webUrl https://contoso.sharepoint.com/sites/test - Removes the value of the property from the property bag located in the given site root folder ```sh -m365 spo propertybag remove --webUrl https://contoso.sharepoint.com/sites/test --key key1 --folder / --confirm +m365 spo propertybag remove --webUrl https://contoso.sharepoint.com/sites/test --key key1 --folder / --force ``` Removes the value of the property from the property bag located in the given site document library diff --git a/docs/docs/cmd/spo/propertybag/propertybag-set.mdx b/docs/docs/cmd/spo/propertybag/propertybag-set.mdx index 721d49d2c88..18ddaca19a9 100644 --- a/docs/docs/cmd/spo/propertybag/propertybag-set.mdx +++ b/docs/docs/cmd/spo/propertybag/propertybag-set.mdx @@ -22,7 +22,7 @@ m365 spo propertybag set [options] `-v, --value ` : Value of the property to be set -`-f, --folder [folder]` +`--folder [folder]` : Site-relative URL of the folder on which the property should be set ``` diff --git a/docs/docs/cmd/spo/report/report-activityfilecounts.mdx b/docs/docs/cmd/spo/report/report-activityfilecounts.mdx index d98a5e9f64b..07449dd6df6 100644 --- a/docs/docs/cmd/spo/report/report-activityfilecounts.mdx +++ b/docs/docs/cmd/spo/report/report-activityfilecounts.mdx @@ -18,7 +18,7 @@ m365 spo report activityfilecounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/spo/report/report-activitypages.mdx b/docs/docs/cmd/spo/report/report-activitypages.mdx index e6a1518214c..4853d69aa80 100644 --- a/docs/docs/cmd/spo/report/report-activitypages.mdx +++ b/docs/docs/cmd/spo/report/report-activitypages.mdx @@ -18,7 +18,7 @@ m365 spo report activitypages [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/spo/report/report-activityusercounts.mdx b/docs/docs/cmd/spo/report/report-activityusercounts.mdx index 605c1a9ccf6..5544a68cf90 100644 --- a/docs/docs/cmd/spo/report/report-activityusercounts.mdx +++ b/docs/docs/cmd/spo/report/report-activityusercounts.mdx @@ -18,7 +18,7 @@ m365 spo report activityusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/spo/report/report-activityuserdetail.mdx b/docs/docs/cmd/spo/report/report-activityuserdetail.mdx index 3f42587a541..eb9a96f83a9 100644 --- a/docs/docs/cmd/spo/report/report-activityuserdetail.mdx +++ b/docs/docs/cmd/spo/report/report-activityuserdetail.mdx @@ -21,7 +21,7 @@ m365 spo report activityuserdetail [options] `-p, --period [period]` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. Specify either `date` or `period`, but not both. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft Teams device usage by user report should be stored in. ``` diff --git a/docs/docs/cmd/spo/report/report-siteusagedetail.mdx b/docs/docs/cmd/spo/report/report-siteusagedetail.mdx index e9c60853bf3..ffc0aef84b0 100644 --- a/docs/docs/cmd/spo/report/report-siteusagedetail.mdx +++ b/docs/docs/cmd/spo/report/report-siteusagedetail.mdx @@ -21,7 +21,7 @@ m365 spo report siteusagedetail [options] `-p, --period [period]` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. Specify either `date` or `period`, but not both. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/spo/report/report-siteusagefilecounts.mdx b/docs/docs/cmd/spo/report/report-siteusagefilecounts.mdx index 9bbe0fdac4b..1f04f429fd3 100644 --- a/docs/docs/cmd/spo/report/report-siteusagefilecounts.mdx +++ b/docs/docs/cmd/spo/report/report-siteusagefilecounts.mdx @@ -18,7 +18,7 @@ m365 spo report siteusagefilecounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/spo/report/report-siteusagepages.mdx b/docs/docs/cmd/spo/report/report-siteusagepages.mdx index 273a6b561f1..4f07fb4e067 100644 --- a/docs/docs/cmd/spo/report/report-siteusagepages.mdx +++ b/docs/docs/cmd/spo/report/report-siteusagepages.mdx @@ -18,7 +18,7 @@ m365 spo report siteusagepages [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/spo/report/report-siteusagesitecounts.mdx b/docs/docs/cmd/spo/report/report-siteusagesitecounts.mdx index 468fcc60434..6d51608769f 100644 --- a/docs/docs/cmd/spo/report/report-siteusagesitecounts.mdx +++ b/docs/docs/cmd/spo/report/report-siteusagesitecounts.mdx @@ -18,7 +18,7 @@ m365 spo report siteusagesitecounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/spo/report/report-siteusagestorage.mdx b/docs/docs/cmd/spo/report/report-siteusagestorage.mdx index 29435ed7c1d..846b6912d88 100644 --- a/docs/docs/cmd/spo/report/report-siteusagestorage.mdx +++ b/docs/docs/cmd/spo/report/report-siteusagestorage.mdx @@ -18,7 +18,7 @@ m365 spo report siteusagestorage [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/spo/roledefinition/roledefinition-remove.mdx b/docs/docs/cmd/spo/roledefinition/roledefinition-remove.mdx index d467cb60dca..2d0e2daf07a 100644 --- a/docs/docs/cmd/spo/roledefinition/roledefinition-remove.mdx +++ b/docs/docs/cmd/spo/roledefinition/roledefinition-remove.mdx @@ -19,7 +19,7 @@ m365 spo roledefinition remove [options] `-i, --id ` : ID of the role definition to remove. -`--confirm` +`-f, --force` : Don't prompt for confirming removing the role definition. ``` @@ -36,7 +36,7 @@ m365 spo roledefinition remove --webUrl https://contoso.sharepoint.com/sites/pro Remove the role definition from the given site and don't prompt for confirmation ```sh -m365 spo roledefinition remove --webUrl https://contoso.sharepoint.com/sites/project-x --id 1 --confirm +m365 spo roledefinition remove --webUrl https://contoso.sharepoint.com/sites/project-x --id 1 --force ``` ## Response diff --git a/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-set.mdx b/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-set.mdx index 61c0d8afc9b..9dba72615f2 100644 --- a/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-set.mdx +++ b/docs/docs/cmd/spo/serviceprincipal/serviceprincipal-set.mdx @@ -24,7 +24,7 @@ m365 spo sp set `-e, --enabled ` : Set to `true` to enable the service principal or to `false` to disable it. Valid values are `true`, `false`. -`--confirm` +`-f, --force` : Don't prompt for confirming enabling/disabling the service principal. ``` @@ -57,7 +57,7 @@ m365 spo serviceprincipal set --enabled false Enable the service principal without prompting for confirmation ```sh -m365 spo serviceprincipal set --enabled true --confirm +m365 spo serviceprincipal set --enabled true --force ``` ## Response diff --git a/docs/docs/cmd/spo/site/site-apppermission-remove.mdx b/docs/docs/cmd/spo/site/site-apppermission-remove.mdx index fbc2bb39004..bd009124e98 100644 --- a/docs/docs/cmd/spo/site/site-apppermission-remove.mdx +++ b/docs/docs/cmd/spo/site/site-apppermission-remove.mdx @@ -25,7 +25,7 @@ m365 spo site apppermission remove [options] `-i, --id [id]` : ID of the permission to remove -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` diff --git a/docs/docs/cmd/spo/site/site-hubsite-disconnect.mdx b/docs/docs/cmd/spo/site/site-hubsite-disconnect.mdx index 8048026fb6e..cb30e980965 100644 --- a/docs/docs/cmd/spo/site/site-hubsite-disconnect.mdx +++ b/docs/docs/cmd/spo/site/site-hubsite-disconnect.mdx @@ -16,7 +16,7 @@ m365 spo site hubsite disconnect [options] `-u, --siteUrl ` : URL of the site collection to disconnect from its hub site -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -33,7 +33,7 @@ m365 spo site hubsite disconnect --siteUrl https://contoso.sharepoint.com/sites/ Disconnect a specific site collection from its hub site without prompting for confirmation. ```sh -m365 spo site hubsite disconnect --siteUrl https://contoso.sharepoint.com/sites/sales --confirm +m365 spo site hubsite disconnect --siteUrl https://contoso.sharepoint.com/sites/sales --force ``` ## Response diff --git a/docs/docs/cmd/spo/site/site-list.mdx b/docs/docs/cmd/spo/site/site-list.mdx index b78718d7caa..e42c510c186 100644 --- a/docs/docs/cmd/spo/site/site-list.mdx +++ b/docs/docs/cmd/spo/site/site-list.mdx @@ -21,7 +21,7 @@ m365 spo site list [options] `--webTemplate [webTemplate]` : type of sites to list. To be used with values like `GROUP#0` and `SITEPAGEPUBLISHING#0`. Specify either `type` or `webTemplate`, but not both. -`-f, --filter [filter]` +`--filter [filter]` : filter to apply when retrieving sites `--includeOneDriveSites` @@ -35,7 +35,7 @@ m365 spo site list [options] ## Remarks -Using the `-f, --filter` option you can specify which sites you want to retrieve. For example, to get sites with _project_ in their URL, use `Url -like 'project'` as the filter. +Using the `--filter` option you can specify which sites you want to retrieve. For example, to get sites with _project_ in their URL, use `Url -like 'project'` as the filter. When using the text output type, the command lists only the values of the `Title`, and `Url` properties of the site. When setting the output type to JSON, all available properties are included in the command output. diff --git a/docs/docs/cmd/spo/site/site-recyclebinitem-clear.mdx b/docs/docs/cmd/spo/site/site-recyclebinitem-clear.mdx index da6d390a6bd..77724fa26ca 100644 --- a/docs/docs/cmd/spo/site/site-recyclebinitem-clear.mdx +++ b/docs/docs/cmd/spo/site/site-recyclebinitem-clear.mdx @@ -19,7 +19,7 @@ m365 spo site recyclebinitem clear [options] `--secondary` : Remove all items from the second-stage recycle bin. When not specified, items from the first-stage recycle bin will be cleared. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/spo/site/site-recyclebinitem-move.mdx b/docs/docs/cmd/spo/site/site-recyclebinitem-move.mdx index abd37c9fc61..7591beeb3d3 100644 --- a/docs/docs/cmd/spo/site/site-recyclebinitem-move.mdx +++ b/docs/docs/cmd/spo/site/site-recyclebinitem-move.mdx @@ -22,7 +22,7 @@ m365 spo site recyclebinitem move [options] `--all` : Move all first-stage recycle bin items to the second-stage recycle bin. Specify either `ids` or `all` but not both. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/spo/site/site-recyclebinitem-remove.mdx b/docs/docs/cmd/spo/site/site-recyclebinitem-remove.mdx index c15918a6be7..8321e846544 100644 --- a/docs/docs/cmd/spo/site/site-recyclebinitem-remove.mdx +++ b/docs/docs/cmd/spo/site/site-recyclebinitem-remove.mdx @@ -19,7 +19,7 @@ m365 spo site recyclebinitem remove [options] `-i, --ids ` : Comma separated list of item IDs. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -44,7 +44,7 @@ m365 spo site recyclebinitem remove --siteUrl https://contoso.sharepoint.com/sit Permanently remove 2 specific items from the recycle bin and skip the confirmation prompt ```sh -m365 spo site recyclebinitem remove --siteUrl https://contoso.sharepoint.com/sites/sales --ids "06ca4fe4-3048-4b76-bd41-296fed4c9881,d679c17b-d7b8-429a-9307-34e1d9e631e7" --confirm +m365 spo site recyclebinitem remove --siteUrl https://contoso.sharepoint.com/sites/sales --ids "06ca4fe4-3048-4b76-bd41-296fed4c9881,d679c17b-d7b8-429a-9307-34e1d9e631e7" --force ``` ## Response diff --git a/docs/docs/cmd/spo/site/site-remove.mdx b/docs/docs/cmd/spo/site/site-remove.mdx index 006c8f478df..802af4c879f 100644 --- a/docs/docs/cmd/spo/site/site-remove.mdx +++ b/docs/docs/cmd/spo/site/site-remove.mdx @@ -25,7 +25,7 @@ m365 spo site remove [options] `--wait` : Wait for the site to be removed before completing the command -`--confirm` +`-f, --force` : Don't prompt for confirming removing the site ``` diff --git a/docs/docs/cmd/spo/sitedesign/sitedesign-remove.mdx b/docs/docs/cmd/spo/sitedesign/sitedesign-remove.mdx index 36e33d9224c..e4aef7f3472 100644 --- a/docs/docs/cmd/spo/sitedesign/sitedesign-remove.mdx +++ b/docs/docs/cmd/spo/sitedesign/sitedesign-remove.mdx @@ -16,7 +16,7 @@ m365 spo sitedesign remove [options] `-i, --id ` : Site design ID -`--confirm` +`-f, --force` : Don't prompt for confirming removing the site design ``` @@ -37,7 +37,7 @@ m365 spo sitedesign remove --id 2c1ba4c4-cd9b-4417-832f-92a34bc34b2a Remove site design with ID _2c1ba4c4-cd9b-4417-832f-92a34bc34b2a_ without prompting for confirmation ```sh -m365 spo sitedesign remove --id 2c1ba4c4-cd9b-4417-832f-92a34bc34b2a --confirm +m365 spo sitedesign remove --id 2c1ba4c4-cd9b-4417-832f-92a34bc34b2a --force ``` ## Response diff --git a/docs/docs/cmd/spo/sitedesign/sitedesign-rights-revoke.mdx b/docs/docs/cmd/spo/sitedesign/sitedesign-rights-revoke.mdx index bcba1b40c88..08b45a5ae30 100644 --- a/docs/docs/cmd/spo/sitedesign/sitedesign-rights-revoke.mdx +++ b/docs/docs/cmd/spo/sitedesign/sitedesign-rights-revoke.mdx @@ -19,7 +19,7 @@ m365 spo sitedesign rights revoke [options] `-p, --principals ` : Comma-separated list of principals to revoke view rights from. Principals can be users or mail-enabled security groups in the form of `alias` or `alias@.com` -`--confirm` +`-f, --force` : Don't prompt for confirming removing the site design ``` @@ -44,7 +44,7 @@ m365 spo sitedesign rights revoke --siteDesignId 2c1ba4c4-cd9b-4417-832f-92a34bc Revoke access to the site design with ID _2c1ba4c4-cd9b-4417-832f-92a34bc34b2a_ from users with aliases _PattiF_ and _AdeleV_ without prompting for confirmation ```sh -m365 spo sitedesign rights revoke --siteDesignId 2c1ba4c4-cd9b-4417-832f-92a34bc34b2a --principals "PattiF,AdeleV" --confirm +m365 spo sitedesign rights revoke --siteDesignId 2c1ba4c4-cd9b-4417-832f-92a34bc34b2a --principals "PattiF,AdeleV" --force ``` ## Response diff --git a/docs/docs/cmd/spo/sitedesign/sitedesign-task-remove.mdx b/docs/docs/cmd/spo/sitedesign/sitedesign-task-remove.mdx index 65513513154..7cbbf06d424 100644 --- a/docs/docs/cmd/spo/sitedesign/sitedesign-task-remove.mdx +++ b/docs/docs/cmd/spo/sitedesign/sitedesign-task-remove.mdx @@ -16,7 +16,7 @@ m365 spo sitedesign task remove [options] `-i, --id ` : The ID of the site design task to remove -`--confirm` +`-f, --force` : Don't prompt for confirming removing the site design task ``` @@ -27,7 +27,7 @@ m365 spo sitedesign task remove [options] Removes the specified site design task with id _6ec3ca5b-d04b-4381-b169-61378556d76e_ scheduled for execution without prompting confirmation ```sh -m365 spo sitedesign task remove --id 6ec3ca5b-d04b-4381-b169-61378556d76e --confirm +m365 spo sitedesign task remove --id 6ec3ca5b-d04b-4381-b169-61378556d76e --force ``` Removes the specified site design task with id _6ec3ca5b-d04b-4381-b169-61378556d76e_ scheduled for execution with prompt for confirmation before removing diff --git a/docs/docs/cmd/spo/sitescript/sitescript-remove.mdx b/docs/docs/cmd/spo/sitescript/sitescript-remove.mdx index a28a001acc0..b4d0f43be13 100644 --- a/docs/docs/cmd/spo/sitescript/sitescript-remove.mdx +++ b/docs/docs/cmd/spo/sitescript/sitescript-remove.mdx @@ -16,7 +16,7 @@ m365 spo sitescript remove [options] `-i, --id ` : Site script ID -`--confirm` +`-f, --force` : Don't prompt for confirming removing the site script ``` @@ -37,7 +37,7 @@ m365 spo sitescript remove --id 2c1ba4c4-cd9b-4417-832f-92a34bc34b2a Remove site script with ID _2c1ba4c4-cd9b-4417-832f-92a34bc34b2a_ without prompting for confirmation ```sh -m365 spo sitescript remove --id 2c1ba4c4-cd9b-4417-832f-92a34bc34b2a --confirm +m365 spo sitescript remove --id 2c1ba4c4-cd9b-4417-832f-92a34bc34b2a --force ``` ## Response diff --git a/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx b/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx index 94653166487..68b9e535211 100644 --- a/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +++ b/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx @@ -19,7 +19,7 @@ m365 spo storageentity remove [options] `-k, --key ` : Name of the tenant property to retrieve -`--confirm` +`-f, --force` : Don't prompt for confirming removal of a tenant property ``` @@ -46,7 +46,7 @@ m365 spo storageentity remove -k AnalyticsId -u https://contoso.sharepoint.com/s Remove the _AnalyticsId_ tenant property. Suppresses the confirmation prompt ```sh -m365 spo storageentity remove -k AnalyticsId --confirm -u https://contoso.sharepoint.com/sites/appcatalog +m365 spo storageentity remove -k AnalyticsId --force -u https://contoso.sharepoint.com/sites/appcatalog ``` ## Response diff --git a/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.mdx b/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.mdx index b13a03c4f30..a5b9c861a3d 100644 --- a/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.mdx +++ b/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.mdx @@ -22,7 +22,7 @@ m365 spo tenant applicationcustomizer remove [options] `-c, --clientSideComponentId [clientSideComponentId]` : The Client Side Component Id (GUID) of the application customizer. Specify either `title`, `id`, or `clientSideComponentId`. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/spo/tenant/tenant-commandset-remove.mdx b/docs/docs/cmd/spo/tenant/tenant-commandset-remove.mdx index d464d7d5403..3c00e5117b5 100644 --- a/docs/docs/cmd/spo/tenant/tenant-commandset-remove.mdx +++ b/docs/docs/cmd/spo/tenant/tenant-commandset-remove.mdx @@ -22,7 +22,7 @@ m365 spo tenant commandset remove [options] `-c, --clientSideComponentId [clientSideComponentId]` : The Client Side Component Id (GUID) of the ListView Command Set. Specify either `title`, `id`, or `clientSideComponentId`. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.mdx b/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.mdx index 360780bf0a5..093fec5589d 100644 --- a/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.mdx +++ b/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.mdx @@ -19,7 +19,7 @@ m365 spo tenant recyclebinitem remove [options] `--wait` : Wait for the site collection to be removed before completing the command -`--confirm` +`-f, --force` : Don't prompt for confirming removing the deleted site collection ``` diff --git a/docs/docs/cmd/spo/theme/theme-remove.mdx b/docs/docs/cmd/spo/theme/theme-remove.mdx index feaf740b16f..8cd1016bb22 100644 --- a/docs/docs/cmd/spo/theme/theme-remove.mdx +++ b/docs/docs/cmd/spo/theme/theme-remove.mdx @@ -16,7 +16,7 @@ m365 spo theme remove [options] `-n, --name ` : Name of the theme to remove -`--confirm` +`-f, --force` : Do not prompt for confirmation before removing theme ``` @@ -41,7 +41,7 @@ m365 spo theme remove --name Contoso-Blue Remove theme without prompting for confirmation ```sh -m365 spo theme remove --name Contoso-Blue --confirm +m365 spo theme remove --name Contoso-Blue --force ``` ## Response diff --git a/docs/docs/cmd/spo/user/user-remove.mdx b/docs/docs/cmd/spo/user/user-remove.mdx index 25f35e9788b..42084485ea0 100644 --- a/docs/docs/cmd/spo/user/user-remove.mdx +++ b/docs/docs/cmd/spo/user/user-remove.mdx @@ -22,7 +22,7 @@ m365 spo user remove [options] `--loginName [loginName]` : Login name of the site user to remove -`--confirm` +`-f, --force` : Do not prompt for confirmation before removing user from web ``` @@ -37,7 +37,7 @@ Use either `id` or `loginName`, but not both Removes user with id _10_ from a web without prompting for confirmation ```sh -m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --id 10 --confirm +m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --id 10 --force ``` Removes user with login name _i:0#.f|membership|john.doe@mytenant.onmicrosoft.com_ from a web diff --git a/docs/docs/cmd/spo/web/web-remove.mdx b/docs/docs/cmd/spo/web/web-remove.mdx index 0122f18f8b9..18b5e3b678f 100644 --- a/docs/docs/cmd/spo/web/web-remove.mdx +++ b/docs/docs/cmd/spo/web/web-remove.mdx @@ -16,7 +16,7 @@ m365 spo web remove [options] `-u, --url ` : URL of the subsite to remove -`--confirm` +`-f, --force` : Do not prompt for confirmation before deleting the subsite ``` @@ -27,7 +27,7 @@ m365 spo web remove [options] Delete subsite without prompting for confirmation ```sh -m365 spo web remove --url https://contoso.sharepoint.com/subsite --confirm +m365 spo web remove --url https://contoso.sharepoint.com/subsite --force ``` ## Response diff --git a/docs/docs/cmd/spo/web/web-roleassignment-remove.mdx b/docs/docs/cmd/spo/web/web-roleassignment-remove.mdx index 289df8004af..e694f8b5297 100644 --- a/docs/docs/cmd/spo/web/web-roleassignment-remove.mdx +++ b/docs/docs/cmd/spo/web/web-roleassignment-remove.mdx @@ -25,7 +25,7 @@ m365 spo web roleassignment remove [options] `--groupName [groupName]` : Enter group name of Azure AD or SharePoint group. Specify either `principalId`, `upn`, or `groupName` but not multiple. -`--confirm [confirm]` +`-f, --force` : Don't prompt for confirming removing the roleassignment. ``` @@ -54,7 +54,7 @@ m365 spo web roleassignment remove --webUrl "https://contoso.sharepoint.com/site Remove roleassignment from web based on principal Id without prompting for confirmation ```sh -m365 spo web roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --principalId 2 --confirm +m365 spo web roleassignment remove --webUrl "https://contoso.sharepoint.com/sites/contoso-sales" --principalId 2 --force ``` ## Response diff --git a/docs/docs/cmd/spo/web/web-roleinheritance-break.mdx b/docs/docs/cmd/spo/web/web-roleinheritance-break.mdx index 5dfecfea174..4385b56d710 100644 --- a/docs/docs/cmd/spo/web/web-roleinheritance-break.mdx +++ b/docs/docs/cmd/spo/web/web-roleinheritance-break.mdx @@ -19,7 +19,7 @@ m365 spo web roleinheritance break [options] `-c, --clearExistingPermissions` : Clears all existing permissions from the web. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/spo/web/web-roleinheritance-reset.mdx b/docs/docs/cmd/spo/web/web-roleinheritance-reset.mdx index b242c17b9a9..0df59bebdd8 100644 --- a/docs/docs/cmd/spo/web/web-roleinheritance-reset.mdx +++ b/docs/docs/cmd/spo/web/web-roleinheritance-reset.mdx @@ -16,7 +16,7 @@ m365 spo web roleinheritance reset [options] `-u, --webUrl ` : URL of the site -`--confirm` +`-f, --force` : Do not prompt for confirmation before resetting role inheritance. ``` @@ -33,7 +33,7 @@ m365 spo web roleinheritance reset --webUrl https://contoso.sharepoint.com/sites Restore role inheritance of subsite _https://contoso.sharepoint.com/sites/project-x_ without prompting for confirmation ```sh -m365 spo web roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --confirm +m365 spo web roleinheritance reset --webUrl https://contoso.sharepoint.com/sites/project-x --force ``` ## Response diff --git a/docs/docs/cmd/teams/app/app-remove.mdx b/docs/docs/cmd/teams/app/app-remove.mdx index b09544e25fc..424c4f12796 100644 --- a/docs/docs/cmd/teams/app/app-remove.mdx +++ b/docs/docs/cmd/teams/app/app-remove.mdx @@ -16,7 +16,7 @@ m365 teams app remove [options] `-i, --id ` : ID of the Teams app to remove. Needs to be available in your organization\'s app catalog. -`--confirm` +`-f, --force` : Don't prompt for confirming removing the app ``` @@ -37,7 +37,7 @@ m365 teams app remove --id 83cece1e-938d-44a1-8b86-918cf6151957 Remove the Teams app with ID _83cece1e-938d-44a1-8b86-918cf6151957_ from the organization's app catalog. Don't prompt for confirmation. ```sh -m365 teams app remove --id 83cece1e-938d-44a1-8b86-918cf6151957 --confirm +m365 teams app remove --id 83cece1e-938d-44a1-8b86-918cf6151957 --force ``` ## Response diff --git a/docs/docs/cmd/teams/app/app-uninstall.mdx b/docs/docs/cmd/teams/app/app-uninstall.mdx index c14b90c0c90..090a6dc2d33 100644 --- a/docs/docs/cmd/teams/app/app-uninstall.mdx +++ b/docs/docs/cmd/teams/app/app-uninstall.mdx @@ -19,7 +19,7 @@ m365 teams app uninstall [options] `--teamId ` : The ID of the Microsoft Teams team from which to uninstall the app -`--confirm` +`-f, --force` : Don't prompt for confirmation when uninstalling the app ``` diff --git a/docs/docs/cmd/teams/cache/cache-remove.mdx b/docs/docs/cmd/teams/cache/cache-remove.mdx index 77d4fe16b90..e9d5f0a39fb 100644 --- a/docs/docs/cmd/teams/cache/cache-remove.mdx +++ b/docs/docs/cmd/teams/cache/cache-remove.mdx @@ -13,7 +13,7 @@ m365 teams cache remove [options] ## Options ```md definition-list -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` diff --git a/docs/docs/cmd/teams/channel/channel-member-remove.mdx b/docs/docs/cmd/teams/channel/channel-member-remove.mdx index b1be55de8af..3a6139c9065 100644 --- a/docs/docs/cmd/teams/channel/channel-member-remove.mdx +++ b/docs/docs/cmd/teams/channel/channel-member-remove.mdx @@ -34,7 +34,7 @@ m365 teams channel member remove [options] `--id [id]` : Channel member Id of a user. Specify either userName, userId or id but not multiple. -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` diff --git a/docs/docs/cmd/teams/channel/channel-remove.mdx b/docs/docs/cmd/teams/channel/channel-remove.mdx index 13d965fcea2..f599268730d 100644 --- a/docs/docs/cmd/teams/channel/channel-remove.mdx +++ b/docs/docs/cmd/teams/channel/channel-remove.mdx @@ -25,7 +25,7 @@ m365 teams channel remove [options] `-n, --name [name]` : The name of the channel to remove. Specify `id` or `name` but not both. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -46,7 +46,7 @@ m365 teams channel remove --id 19:f3dcbb1674574677abcae89cb626f1e6@thread.skype Remove the specified Microsoft Teams channel by Id without confirmation ```sh -m365 teams channel remove --id 19:f3dcbb1674574677abcae89cb626f1e6@thread.skype --teamId d66b8110-fcad-49e8-8159-0d488ddb7656 --confirm +m365 teams channel remove --id 19:f3dcbb1674574677abcae89cb626f1e6@thread.skype --teamId d66b8110-fcad-49e8-8159-0d488ddb7656 --force ``` Remove the specified Microsoft Teams channel by Name @@ -58,7 +58,7 @@ m365 teams channel remove --name 'name' --teamName "Team Name" Remove the specified Microsoft Teams channel by Name without confirmation ```sh -m365 teams channel remove --name 'name' --teamName "Team Name" --confirm +m365 teams channel remove --name 'name' --teamName "Team Name" --force ``` ## Response diff --git a/docs/docs/cmd/teams/chat/chat-member-remove.mdx b/docs/docs/cmd/teams/chat/chat-member-remove.mdx index 0363c6d5593..69a005d894b 100644 --- a/docs/docs/cmd/teams/chat/chat-member-remove.mdx +++ b/docs/docs/cmd/teams/chat/chat-member-remove.mdx @@ -25,7 +25,7 @@ m365 teams chat member remove [options] `--userName [userName]` : User's UPN (user principal name, e.g. johndoe@example.com). Specify either `id`, `userId`, or `userName` but not multiple. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` @@ -36,7 +36,7 @@ m365 teams chat member remove [options] Remove a member from a Teams chat by its member ID without prompting for confirmation. ```sh -m365 teams chat member remove --chatId 19:8b081ef6-4792-4def-b2c9-c363a1bf41d5_5031bb31-22c0-4f6f-9f73-91d34ab2b32d@unq.gbl.spaces --id MCMjMjQzMmI1N2ItMGFiZC00M2RiLWFhN2ItMTZlYWRkMTE1ZDM0IyMxOTpiZDlkYTQ2MzIzYWY0MjUzOTZkMGZhNjcyMDAyODk4NEB0aHJlYWQudjIjIzQ4YmY5ZDUyLWRjYTctNGE1Zi04Mzk4LTM3Yjk1Y2M3YmQ4Mw== --confirm +m365 teams chat member remove --chatId 19:8b081ef6-4792-4def-b2c9-c363a1bf41d5_5031bb31-22c0-4f6f-9f73-91d34ab2b32d@unq.gbl.spaces --id MCMjMjQzMmI1N2ItMGFiZC00M2RiLWFhN2ItMTZlYWRkMTE1ZDM0IyMxOTpiZDlkYTQ2MzIzYWY0MjUzOTZkMGZhNjcyMDAyODk4NEB0aHJlYWQudjIjIzQ4YmY5ZDUyLWRjYTctNGE1Zi04Mzk4LTM3Yjk1Y2M3YmQ4Mw== --force ``` Remove a member from a Teams chat by its Azure AD ID. diff --git a/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.mdx b/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.mdx index a6a55f22e97..f90f08a935a 100644 --- a/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.mdx +++ b/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.mdx @@ -18,7 +18,7 @@ m365 teams report deviceusagedistributionusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft Teams unique users by device type report should be stored in. ``` diff --git a/docs/docs/cmd/teams/report/report-deviceusageusercounts.mdx b/docs/docs/cmd/teams/report/report-deviceusageusercounts.mdx index 8f5dac4a6e1..1b058a14a23 100644 --- a/docs/docs/cmd/teams/report/report-deviceusageusercounts.mdx +++ b/docs/docs/cmd/teams/report/report-deviceusageusercounts.mdx @@ -18,7 +18,7 @@ m365 teams report deviceusageusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft Teams daily unique users by device type report should be stored in. ``` diff --git a/docs/docs/cmd/teams/report/report-deviceusageuserdetail.mdx b/docs/docs/cmd/teams/report/report-deviceusageuserdetail.mdx index a2f18c973fa..8ee18fb4186 100644 --- a/docs/docs/cmd/teams/report/report-deviceusageuserdetail.mdx +++ b/docs/docs/cmd/teams/report/report-deviceusageuserdetail.mdx @@ -21,7 +21,7 @@ m365 teams report deviceusageuserdetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is `YYYY-MM-DD`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft Teams device usage by user report should be stored in. ``` diff --git a/docs/docs/cmd/teams/report/report-useractivitycounts.mdx b/docs/docs/cmd/teams/report/report-useractivitycounts.mdx index 997b95787ed..dc59ff32701 100644 --- a/docs/docs/cmd/teams/report/report-useractivitycounts.mdx +++ b/docs/docs/cmd/teams/report/report-useractivitycounts.mdx @@ -18,7 +18,7 @@ m365 teams report useractivitycounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft Teams activities by activity type report should be stored in. ``` diff --git a/docs/docs/cmd/teams/report/report-useractivityusercounts.mdx b/docs/docs/cmd/teams/report/report-useractivityusercounts.mdx index 3481d14a5d1..5f35352d8ca 100644 --- a/docs/docs/cmd/teams/report/report-useractivityusercounts.mdx +++ b/docs/docs/cmd/teams/report/report-useractivityusercounts.mdx @@ -18,7 +18,7 @@ m365 teams report useractivityusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft Teams users by activity type report should be stored in. ``` diff --git a/docs/docs/cmd/teams/report/report-useractivityuserdetail.mdx b/docs/docs/cmd/teams/report/report-useractivityuserdetail.mdx index eb5209df3b6..8b7d4b9ee41 100644 --- a/docs/docs/cmd/teams/report/report-useractivityuserdetail.mdx +++ b/docs/docs/cmd/teams/report/report-useractivityuserdetail.mdx @@ -21,7 +21,7 @@ m365 teams report useractivityuserdetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is `YYYY-MM-DD`. Specify the `date` or `period`, but not both. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft Teams user activity by user report should be stored in. ``` diff --git a/docs/docs/cmd/teams/tab/tab-remove.mdx b/docs/docs/cmd/teams/tab/tab-remove.mdx index 1565b3c5d87..a89f6ff2221 100644 --- a/docs/docs/cmd/teams/tab/tab-remove.mdx +++ b/docs/docs/cmd/teams/tab/tab-remove.mdx @@ -22,7 +22,7 @@ m365 teams tab remove [options] `-i, --id ` : The ID of the tab to remove -`--confirm` +`-f, --force` : Don't prompt for confirmation ``` @@ -39,7 +39,7 @@ m365 teams tab remove --teamId 00000000-0000-0000-0000-000000000000 --channelId Removes a tab from the specified channel without prompting for confirmation ```sh -m365 teams tab remove --teamId 00000000-0000-0000-0000-000000000000 --channelId 19:00000000000000000000000000000000@thread.skype --id 06805b9e-77e3-4b93-ac81-525eb87513b8 --confirm +m365 teams tab remove --teamId 00000000-0000-0000-0000-000000000000 --channelId 19:00000000000000000000000000000000@thread.skype --id 06805b9e-77e3-4b93-ac81-525eb87513b8 --force ``` ## Response diff --git a/docs/docs/cmd/teams/team/team-remove.mdx b/docs/docs/cmd/teams/team/team-remove.mdx index 531763290b8..da015d3f16f 100644 --- a/docs/docs/cmd/teams/team/team-remove.mdx +++ b/docs/docs/cmd/teams/team/team-remove.mdx @@ -19,7 +19,7 @@ m365 teams team remove [options] `-n, --name [name]` : The display name of the Microsoft Teams team to remove. Specify either `id` or `name` but not both. -`--confirm` +`-f, --force` : Don't prompt for confirming removing the specified team. ``` @@ -48,7 +48,7 @@ m365 teams team remove --name "Team Name" Removes the specified team without confirmation. ```sh -m365 teams team remove --id 00000000-0000-0000-0000-000000000000 --confirm +m365 teams team remove --id 00000000-0000-0000-0000-000000000000 --force ``` ## Response diff --git a/docs/docs/cmd/teams/user/user-app-remove.mdx b/docs/docs/cmd/teams/user/user-app-remove.mdx index 9ff8cbbc51a..cda4387a971 100644 --- a/docs/docs/cmd/teams/user/user-app-remove.mdx +++ b/docs/docs/cmd/teams/user/user-app-remove.mdx @@ -19,7 +19,7 @@ m365 teams user app remove [options] `--userId ` : The ID of the user to uninstall the app for. -`--confirm` +`-f, --force` : Confirm removal of app for user. ``` diff --git a/docs/docs/cmd/tenant/report/report-activeusercounts.mdx b/docs/docs/cmd/tenant/report/report-activeusercounts.mdx index 40c3912ce07..85d8d6a56e8 100644 --- a/docs/docs/cmd/tenant/report/report-activeusercounts.mdx +++ b/docs/docs/cmd/tenant/report/report-activeusercounts.mdx @@ -18,7 +18,7 @@ m365 tenant report activeusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the Microsoft Teams daily unique users by device type report should be stored in. ``` diff --git a/docs/docs/cmd/tenant/report/report-activeuserdetail.mdx b/docs/docs/cmd/tenant/report/report-activeuserdetail.mdx index 0d46f4bfd12..9e14955f776 100644 --- a/docs/docs/cmd/tenant/report/report-activeuserdetail.mdx +++ b/docs/docs/cmd/tenant/report/report-activeuserdetail.mdx @@ -21,7 +21,7 @@ m365 tenant report activeuserdetail [options] `-p, --period [period]` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/tenant/report/report-servicesusercounts.mdx b/docs/docs/cmd/tenant/report/report-servicesusercounts.mdx index ce685a2c2d1..e003cda59af 100644 --- a/docs/docs/cmd/tenant/report/report-servicesusercounts.mdx +++ b/docs/docs/cmd/tenant/report/report-servicesusercounts.mdx @@ -18,7 +18,7 @@ m365 tenant report servicesusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in. ``` diff --git a/docs/docs/cmd/todo/list/list-remove.mdx b/docs/docs/cmd/todo/list/list-remove.mdx index aee772cd0ea..128a493153d 100644 --- a/docs/docs/cmd/todo/list/list-remove.mdx +++ b/docs/docs/cmd/todo/list/list-remove.mdx @@ -19,7 +19,7 @@ m365 todo list remove [options] `-i, --id [id]` : The ID of the task list to remove. Specify either `id` or `name`, but not both. -`--confirm` +`-f, --force` : Don't prompt for confirming removing the task list. ``` @@ -36,7 +36,7 @@ m365 todo list remove --name "My task list" Remove a task list with the ID without confirmation prompt ```sh -m365 todo list remove --id "AAMkAGI3NDhlZmQzLWQxYjAtNGJjNy04NmYwLWQ0M2IzZTNlMDUwNAAuAAAAAACQ1l2jfH6VSZraktP8Z7auAQCbV93BagWITZhL3J6BMqhjAAD9pHIhAAA=" --confirm +m365 todo list remove --id "AAMkAGI3NDhlZmQzLWQxYjAtNGJjNy04NmYwLWQ0M2IzZTNlMDUwNAAuAAAAAACQ1l2jfH6VSZraktP8Z7auAQCbV93BagWITZhL3J6BMqhjAAD9pHIhAAA=" --force ``` ## Response diff --git a/docs/docs/cmd/todo/task/task-remove.mdx b/docs/docs/cmd/todo/task/task-remove.mdx index edeb3959325..ce0b1c89ceb 100644 --- a/docs/docs/cmd/todo/task/task-remove.mdx +++ b/docs/docs/cmd/todo/task/task-remove.mdx @@ -22,7 +22,7 @@ m365 todo task remove [options] `--listId [listId]` : The id of the task list in which the task exists. Specify either `listId` or `listName`, but not both. -`--confirm` +`-f, --force` : Don't prompt for confirmation. ``` diff --git a/docs/docs/cmd/yammer/group/group-user-remove.mdx b/docs/docs/cmd/yammer/group/group-user-remove.mdx index 2375467bf8f..18dcb394a3a 100644 --- a/docs/docs/cmd/yammer/group/group-user-remove.mdx +++ b/docs/docs/cmd/yammer/group/group-user-remove.mdx @@ -19,7 +19,7 @@ m365 yammer group user remove [options] `--id [id]` : ID of the user to remove from the group. If not specified, removes the current user -`--confirm` +`-f, --force` : Don't prompt for confirmation before removing the user from the group ``` @@ -50,7 +50,7 @@ m365 yammer group user remove --groupId 5611239081 --id 66622349 Remove the user with the ID `66622349` from the group with the ID `5611239081` without asking for confirmation ```sh -m365 yammer group user remove --groupId 5611239081 --id 66622349 --confirm +m365 yammer group user remove --groupId 5611239081 --id 66622349 --force ``` ## Response diff --git a/docs/docs/cmd/yammer/message/message-like-set.mdx b/docs/docs/cmd/yammer/message/message-like-set.mdx index ffae4b1b591..10d54f63601 100644 --- a/docs/docs/cmd/yammer/message/message-like-set.mdx +++ b/docs/docs/cmd/yammer/message/message-like-set.mdx @@ -19,7 +19,7 @@ m365 yammer message like set [options] `--enable [enable]` : Set to `true` to like a message. Set to `false` to unlike it. Default `true` -`--confirm` +`-f, --force` : Don't prompt for confirmation before unliking a message ``` @@ -50,7 +50,7 @@ m365 yammer message like set --messageId 5611239081 --enable false Unlike the message with the ID `5611239081` without asking for confirmation ```sh -m365 yammer message like set --messageId 5611239081 --enable false --confirm +m365 yammer message like set --messageId 5611239081 --enable false --force ``` ## Response diff --git a/docs/docs/cmd/yammer/message/message-list.mdx b/docs/docs/cmd/yammer/message/message-list.mdx index cb09c0365fc..f81b5798299 100644 --- a/docs/docs/cmd/yammer/message/message-list.mdx +++ b/docs/docs/cmd/yammer/message/message-list.mdx @@ -21,7 +21,7 @@ m365 yammer message list [options] `--threaded` : Will only return the thread starter (first message) for each thread. This parameter is intended for apps which need to display message threads collapsed -`-f, --feedType [feedType]` +`--feedType [feedType]` : Returns messages from a specific feed. Available options: `All`, `Top`, `My`, `Following`, `Sent`, `Private`, `Received`. Default `All` `--groupId [groupId]` diff --git a/docs/docs/cmd/yammer/message/message-remove.mdx b/docs/docs/cmd/yammer/message/message-remove.mdx index b25477103fd..9a8bba8786a 100644 --- a/docs/docs/cmd/yammer/message/message-remove.mdx +++ b/docs/docs/cmd/yammer/message/message-remove.mdx @@ -16,7 +16,7 @@ m365 yammer message remove [options] `--id ` : The id of the Yammer message -`--confirm` +`-f, --force` : Don't prompt for confirming removing the Yammer message ``` @@ -47,7 +47,7 @@ m365 yammer message remove --id 1239871123 Removes the Yammer message with the id _1239871123_ without prompting for confirmation. ```sh -m365 yammer message remove --id 1239871123 --confirm +m365 yammer message remove --id 1239871123 --force ``` ## Response diff --git a/docs/docs/cmd/yammer/report/report-activitycounts.mdx b/docs/docs/cmd/yammer/report/report-activitycounts.mdx index 185711f27a1..d3489b0abdb 100644 --- a/docs/docs/cmd/yammer/report/report-activitycounts.mdx +++ b/docs/docs/cmd/yammer/report/report-activitycounts.mdx @@ -18,7 +18,7 @@ m365 yammer report activitycounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/yammer/report/report-activityusercounts.mdx b/docs/docs/cmd/yammer/report/report-activityusercounts.mdx index beca35eebe2..9adb0d0c412 100644 --- a/docs/docs/cmd/yammer/report/report-activityusercounts.mdx +++ b/docs/docs/cmd/yammer/report/report-activityusercounts.mdx @@ -18,7 +18,7 @@ m365 yammer report activityusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/yammer/report/report-activityuserdetail.mdx b/docs/docs/cmd/yammer/report/report-activityuserdetail.mdx index 1829903a9ee..30b84d9f4f0 100644 --- a/docs/docs/cmd/yammer/report/report-activityuserdetail.mdx +++ b/docs/docs/cmd/yammer/report/report-activityuserdetail.mdx @@ -21,7 +21,7 @@ m365 yammer report activityuserdetail [options] `-p, --period [period]` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.mdx b/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.mdx index e38a38fff16..60e3f0d84f2 100644 --- a/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.mdx +++ b/docs/docs/cmd/yammer/report/report-deviceusagedistributionusercounts.mdx @@ -18,7 +18,7 @@ m365 yammer report deviceusagedistributionusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/yammer/report/report-deviceusageusercounts.mdx b/docs/docs/cmd/yammer/report/report-deviceusageusercounts.mdx index 5d7b1b9be4b..21f1598d805 100644 --- a/docs/docs/cmd/yammer/report/report-deviceusageusercounts.mdx +++ b/docs/docs/cmd/yammer/report/report-deviceusageusercounts.mdx @@ -18,7 +18,7 @@ m365 yammer report deviceusageusercounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.mdx b/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.mdx index fd92e6e1182..3d429d5d458 100644 --- a/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.mdx +++ b/docs/docs/cmd/yammer/report/report-deviceusageuserdetail.mdx @@ -21,7 +21,7 @@ m365 yammer report deviceusageuserdetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is `YYYY-MM-DD`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/yammer/report/report-groupsactivitycounts.mdx b/docs/docs/cmd/yammer/report/report-groupsactivitycounts.mdx index 1f6fe44e9ef..869851e72ea 100644 --- a/docs/docs/cmd/yammer/report/report-groupsactivitycounts.mdx +++ b/docs/docs/cmd/yammer/report/report-groupsactivitycounts.mdx @@ -18,7 +18,7 @@ m365 yammer report groupsactivitycounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/yammer/report/report-groupsactivitydetail.mdx b/docs/docs/cmd/yammer/report/report-groupsactivitydetail.mdx index c8a531e9c16..df2ae9e5ce6 100644 --- a/docs/docs/cmd/yammer/report/report-groupsactivitydetail.mdx +++ b/docs/docs/cmd/yammer/report/report-groupsactivitydetail.mdx @@ -21,7 +21,7 @@ m365 yammer report groupsactivitydetail [options] `-d, --date [date]` : The date for which you would like to view the users who performed any activity. Supported date format is `YYYY-MM-DD`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.mdx b/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.mdx index 6157e9d1f9a..bdc779ccca0 100644 --- a/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.mdx +++ b/docs/docs/cmd/yammer/report/report-groupsactivitygroupcounts.mdx @@ -18,7 +18,7 @@ m365 yammer report groupsactivitygroupcounts [options] `-p, --period ` : The length of time over which the report is aggregated. Supported values `D7`, `D30`, `D90`, `D180`. -`-f, --outputFile [outputFile]` +`--outputFile [outputFile]` : Path to the file where the report should be stored in ``` diff --git a/docs/docs/sample-scripts/aad/bulk-manage-group-users/index.mdx b/docs/docs/sample-scripts/aad/bulk-manage-group-users/index.mdx index cd3de630732..16ed2ae996c 100644 --- a/docs/docs/sample-scripts/aad/bulk-manage-group-users/index.mdx +++ b/docs/docs/sample-scripts/aad/bulk-manage-group-users/index.mdx @@ -51,7 +51,7 @@ Note: Refactor the code as per your requirement. } } ElseIf ($action -eq "remove") { - m365 aad o365group user remove --groupId $group.id --userName $user.mail --confirm + m365 aad o365group user remove --groupId $group.id --userName $user.mail --force Write-Host $user.mail " removed from " $group.mailNickname } Else { diff --git a/docs/docs/sample-scripts/aad/delete-m365-groups-and-sharepoint-sites/index.mdx b/docs/docs/sample-scripts/aad/delete-m365-groups-and-sharepoint-sites/index.mdx index 9d8643b977e..91917413b4e 100644 --- a/docs/docs/sample-scripts/aad/delete-m365-groups-and-sharepoint-sites/index.mdx +++ b/docs/docs/sample-scripts/aad/delete-m365-groups-and-sharepoint-sites/index.mdx @@ -48,7 +48,7 @@ Another example how you can delete all Microsoft 365 Groups and SharePoint Onlin foreach ($group in $allGroups) { $groupCounter++ Write-Host "Deleting $($group.displayName)... ($groupCounter/$groupCount)" - m365 aad o365group remove --id $group.id --confirm $true + m365 aad o365group remove --id $group.id --force } Write-host "Retrieving all SPO sites..." @@ -62,7 +62,7 @@ Another example how you can delete all Microsoft 365 Groups and SharePoint Onlin foreach ($site in $allSites) { $siteCounter++ Write-Host "Deleting $($site.Url)... ($siteCounter/$siteCount)" - m365 spo site remove --url $site.Url --skipRecycleBin $skipRecycleBin --confirm $true + m365 spo site remove --url $site.Url --skipRecycleBin $skipRecycleBin --force } ``` diff --git a/docs/docs/sample-scripts/aad/delete-m365-groups/index.mdx b/docs/docs/sample-scripts/aad/delete-m365-groups/index.mdx index d337f33460b..35f3e700b24 100644 --- a/docs/docs/sample-scripts/aad/delete-m365-groups/index.mdx +++ b/docs/docs/sample-scripts/aad/delete-m365-groups/index.mdx @@ -30,7 +30,7 @@ There are so many different ways to create Microsoft 365 groups. Teams, Planner, { $progress++ Write-Host $progress / $total":" $group.displayName - m365 aad o365group remove --id $group.id --confirm + m365 aad o365group remove --id $group.id --force } ``` @@ -70,7 +70,7 @@ There are so many different ways to create Microsoft 365 groups. Teams, Planner, displayName=$(echo $o365group | cut -d';' -f 1) id=$(echo $o365group | cut -d';' -f 2) echo "Deleting $displayName..." - m365 aad o365group remove --id $id --confirm + m365 aad o365group remove --id $id --force done ``` diff --git a/docs/docs/sample-scripts/flow/cancel-all-running-flow-runs/index.mdx b/docs/docs/sample-scripts/flow/cancel-all-running-flow-runs/index.mdx index fc177cc1a8e..da0a7095117 100644 --- a/docs/docs/sample-scripts/flow/cancel-all-running-flow-runs/index.mdx +++ b/docs/docs/sample-scripts/flow/cancel-all-running-flow-runs/index.mdx @@ -27,7 +27,7 @@ This script will cancel all running flow runs of a Power Automate flow created i foreach ($run in $flowRuns) { Write-Output "Run details: " $run # Cancel all the running flow runs - m365 flow run cancel --environmentName $flowEnvironment --flow $flowGUID --name $run.name --confirm + m365 flow run cancel --environmentName $flowEnvironment --flow $flowGUID --name $run.name --force Write-Output "Run Cancelled successfully" } ``` diff --git a/docs/docs/sample-scripts/flow/export-flow-logicapp/index.mdx b/docs/docs/sample-scripts/flow/export-flow-logicapp/index.mdx index 1855b120f66..6c2bf8a4124 100644 --- a/docs/docs/sample-scripts/flow/export-flow-logicapp/index.mdx +++ b/docs/docs/sample-scripts/flow/export-flow-logicapp/index.mdx @@ -27,7 +27,7 @@ This script will export the Power Automate flow *Your sample test flow*, make su $flowId = $(m365 flow list --environmentName $environmentId --query "[?displayName == 'Your sample test flow']" -o json | ConvertFrom-Json)[0].Name Write-Output "Getting Flow info..." - m365 flow export --environmentName $environmentId --id $flowId -f 'json' + m365 flow export --environmentName $environmentId --id $flowId --format 'json' Write-Output "Complete" ``` diff --git a/docs/docs/sample-scripts/flow/resubmit-all-failed-flow-runs/index.mdx b/docs/docs/sample-scripts/flow/resubmit-all-failed-flow-runs/index.mdx index fa22bb50fb7..03400aac2f7 100644 --- a/docs/docs/sample-scripts/flow/resubmit-all-failed-flow-runs/index.mdx +++ b/docs/docs/sample-scripts/flow/resubmit-all-failed-flow-runs/index.mdx @@ -26,7 +26,7 @@ This script will resubmit all failed flow runs of a Power Automate flow created foreach ($run in $flowRuns) { Write-Output "Run details: " $run #Resubmit all the failed flows - m365 flow run resubmit --environmentName $flowEnvironment --flowName $flowGUID --name $run.name --confirm + m365 flow run resubmit --environmentName $flowEnvironment --flowName $flowGUID --name $run.name --force Write-Output "Run resubmitted successfully" } ``` diff --git a/docs/docs/sample-scripts/spo/change-owner-group-membership/index.mdx b/docs/docs/sample-scripts/spo/change-owner-group-membership/index.mdx index bcf032377f7..7fc33450dca 100644 --- a/docs/docs/sample-scripts/spo/change-owner-group-membership/index.mdx +++ b/docs/docs/sample-scripts/spo/change-owner-group-membership/index.mdx @@ -45,7 +45,7 @@ This is a script which takes a subset or all members of the default owner group m365 spo group member add --webUrl $site.Url --groupId $AssociatedGroups.MemberGroup.Id --userName "$($User.UserPrincipalName)" # Removing the user from Owner Group - m365 spo group member remove --webUrl $site.Url --groupId $AssociatedGroups.OwnerGroup.Id --userName "$($User.UserPrincipalName)" --confirm + m365 spo group member remove --webUrl $site.Url --groupId $AssociatedGroups.OwnerGroup.Id --userName "$($User.UserPrincipalName)" --force } $SiteCounter++ } diff --git a/docs/docs/sample-scripts/spo/delete-custom-themes/index.mdx b/docs/docs/sample-scripts/spo/delete-custom-themes/index.mdx index dd188dab227..113d9bae3aa 100644 --- a/docs/docs/sample-scripts/spo/delete-custom-themes/index.mdx +++ b/docs/docs/sample-scripts/spo/delete-custom-themes/index.mdx @@ -29,7 +29,7 @@ Have you been creating a lot of beautiful themes lately and testing them in your { $progress++ write-host $progress / $total":" $theme.name - m365 spo theme remove --name "$($theme.name)" --confirm + m365 spo theme remove --name "$($theme.name)" --force } ``` @@ -66,7 +66,7 @@ Have you been creating a lot of beautiful themes lately and testing them in your for theme in "${themestoremove[@]}"; do echo "Deleting $theme..." - m365 spo theme remove --name "$theme" --confirm + m365 spo theme remove --name "$theme" --force done ``` diff --git a/docs/docs/sample-scripts/spo/delete-site-designs/index.mdx b/docs/docs/sample-scripts/spo/delete-site-designs/index.mdx index 4d92dc51bbc..e621440d83a 100644 --- a/docs/docs/sample-scripts/spo/delete-site-designs/index.mdx +++ b/docs/docs/sample-scripts/spo/delete-site-designs/index.mdx @@ -28,7 +28,7 @@ Site designs and especially site scripts can be something that ends up just hang { $progress++ write-host $progress / $total":" $sitedesign.Title - m365 spo sitedesign remove --id "$($sitedesign.Id)" --confirm + m365 spo sitedesign remove --id "$($sitedesign.Id)" --force } ``` @@ -67,7 +67,7 @@ Site designs and especially site scripts can be something that ends up just hang for sitedesign in "${sitedesignstoremove[@]}"; do designinfo=(${sitedesign//;/ }) echo "Deleting ${designinfo[0]}..." - m365 spo sitedesign remove --id "${designinfo[1]}" --confirm + m365 spo sitedesign remove --id "${designinfo[1]}" --force done ``` diff --git a/docs/docs/sample-scripts/spo/delete-site-scripts/index.mdx b/docs/docs/sample-scripts/spo/delete-site-scripts/index.mdx index 1d4f648df75..669cc8a6e4c 100644 --- a/docs/docs/sample-scripts/spo/delete-site-scripts/index.mdx +++ b/docs/docs/sample-scripts/spo/delete-site-scripts/index.mdx @@ -28,7 +28,7 @@ Site designs and especially site scripts can be something that ends up just hang { $progress++ Write-Host $progress / $total":" $siteScript.Title - m365 spo sitescript remove -i $siteScript.Id --confirm + m365 spo sitescript remove -i $siteScript.Id --force } ``` @@ -69,7 +69,7 @@ Site designs and especially site scripts can be something that ends up just hang scriptTitle=$(echo ${script} | jq -r '.Title') scriptId=$(echo ${script} | jq -r '.Id') echo "Deleting Site script..." $scriptTitle - m365 spo sitescript remove --id $scriptId --confirm + m365 spo sitescript remove --id $scriptId --force done ``` diff --git a/docs/docs/sample-scripts/spo/empty-tenant-recyclebin/index.mdx b/docs/docs/sample-scripts/spo/empty-tenant-recyclebin/index.mdx index d08707fffaa..cccb71eba1c 100644 --- a/docs/docs/sample-scripts/spo/empty-tenant-recyclebin/index.mdx +++ b/docs/docs/sample-scripts/spo/empty-tenant-recyclebin/index.mdx @@ -30,7 +30,7 @@ Your deleted modern SharePoint sites are not going to disappear from the UI befo { $progress++ Write-Host $progress / $total":" $deletedSite.Url - m365 spo tenant recyclebinitem remove -u $deletedSite.Url --confirm + m365 spo tenant recyclebinitem remove -u $deletedSite.Url --force } ``` @@ -58,7 +58,7 @@ Your deleted modern SharePoint sites are not going to disappear from the UI befo for deletedsite in "${deletedsites[@]}"; do ((progress++)) printf '%s / %s:%s\n' "$progress" "$total" "$deletedsite" - m365 spo tenant recyclebinitem remove -u $deletedsite --confirm + m365 spo tenant recyclebinitem remove -u $deletedsite --force done ``` diff --git a/docs/docs/sample-scripts/spo/list-all-list-folders-itemcount/index.mdx b/docs/docs/sample-scripts/spo/list-all-list-folders-itemcount/index.mdx index 6141e1c098f..c644af207f8 100644 --- a/docs/docs/sample-scripts/spo/list-all-list-folders-itemcount/index.mdx +++ b/docs/docs/sample-scripts/spo/list-all-list-folders-itemcount/index.mdx @@ -34,7 +34,7 @@ List all Lists, the folders and sub folders in a given site, and output the item $folders = m365 spo folder list -u $webUrl --parentFolderUrl $folderUrl -o json | ConvertFrom-Json foreach ($folder in $folders) { - $folderStats = m365 spo folder get -u $webUrl --f $folder.ServerRelativeUrl -o json | ConvertFrom-Json + $folderStats = m365 spo folder get -u $webUrl --url $folder.ServerRelativeUrl -o json | ConvertFrom-Json Write-Output "Processing folder: $($folder.ServerRelativeUrl);" [void]$results.Add([pscustomobject]@{ Url = $folder.ServerRelativeUrl; ItemCount = $folderStats.ItemCount; Type = "Folder"; }) diff --git a/docs/docs/sample-scripts/spo/make-list-or-library-read-only-for-all-users/index.mdx b/docs/docs/sample-scripts/spo/make-list-or-library-read-only-for-all-users/index.mdx index d21f96e3897..3da0019a0f6 100644 --- a/docs/docs/sample-scripts/spo/make-list-or-library-read-only-for-all-users/index.mdx +++ b/docs/docs/sample-scripts/spo/make-list-or-library-read-only-for-all-users/index.mdx @@ -38,7 +38,7 @@ The following script breaks the role inheritance of the given list if it doesn't #Break Permissions of the List if ($List.HasUniqueRoleAssignments -eq $False) { - m365 spo list roleinheritance break --webUrl $SiteURL --listTitle $ListName --confirm + m365 spo list roleinheritance break --webUrl $SiteURL --listTitle $ListName --force } #Get Read Permission Level @@ -57,7 +57,7 @@ The following script breaks the role inheritance of the given list if it doesn't #Remove All permissions ForEach($RoleDefBinding in $PermissionsToReplace) { - m365 spo list roleassignment remove --webUrl $SiteURL --listTitle $ListName --principalId $RoleAssignment.Member.Id --confirm + m365 spo list roleassignment remove --webUrl $SiteURL --listTitle $ListName --principalId $RoleAssignment.Member.Id --force Write-Host "Removed all role assignments for '$($RoleDefBinding.Member.Title)'" -ForegroundColor Yellow } diff --git a/docs/docs/sample-scripts/spo/remove-non-team-members-from-list/index.mdx b/docs/docs/sample-scripts/spo/remove-non-team-members-from-list/index.mdx index 50987f34202..42d73706b34 100644 --- a/docs/docs/sample-scripts/spo/remove-non-team-members-from-list/index.mdx +++ b/docs/docs/sample-scripts/spo/remove-non-team-members-from-list/index.mdx @@ -58,7 +58,7 @@ Email | Text | Yes if ($null -eq $match ) { Write-Host ("Removing '{0}' from the '{1}' list..." -f $($listMember.Email), $listName) -ForegroundColor Yellow $membersRemoved = $true - m365 spo listitem remove --webUrl $siteUrl --listTitle $listName --id $listMember.Id --confirm + m365 spo listitem remove --webUrl $siteUrl --listTitle $listName --id $listMember.Id --force } } diff --git a/docs/docs/sample-scripts/spo/remove-siteCollection-admin-user/index.mdx b/docs/docs/sample-scripts/spo/remove-siteCollection-admin-user/index.mdx index 7ad530bdf73..51e7401d892 100644 --- a/docs/docs/sample-scripts/spo/remove-siteCollection-admin-user/index.mdx +++ b/docs/docs/sample-scripts/spo/remove-siteCollection-admin-user/index.mdx @@ -63,7 +63,7 @@ Inspired By: [Salaudeen Rajack](https://www.sharepointdiary.com/2017/02/sharepoi #Remove the user Write-Host "User $($UserToRemove) is an Admin in $($site.Title). Removing..." -f Blue - m365 spo user remove --webUrl "$($site.Url)" --id $userToRemoveID --confirm + m365 spo user remove --webUrl "$($site.Url)" --id $userToRemoveID --force } } } diff --git a/docs/docs/sample-scripts/spo/replace-site-collection-admin/index.mdx b/docs/docs/sample-scripts/spo/replace-site-collection-admin/index.mdx index ab09dccb0d2..9d6c9c9c21c 100644 --- a/docs/docs/sample-scripts/spo/replace-site-collection-admin/index.mdx +++ b/docs/docs/sample-scripts/spo/replace-site-collection-admin/index.mdx @@ -29,7 +29,7 @@ The script removes a user from a site collection and adds a new one as site coll m365 login } - m365 spo user remove --webUrl $webUrl --loginName "i:0#.f|membership|$userToRemove" --confirm + m365 spo user remove --webUrl $webUrl --loginName "i:0#.f|membership|$userToRemove" --force m365 spo site set --url $webUrl --owners $userToAdd ``` diff --git a/docs/docs/sample-scripts/spo/setup-example-site/index.mdx b/docs/docs/sample-scripts/spo/setup-example-site/index.mdx index 72e0b04f019..7268d5153e4 100644 --- a/docs/docs/sample-scripts/spo/setup-example-site/index.mdx +++ b/docs/docs/sample-scripts/spo/setup-example-site/index.mdx @@ -151,7 +151,7 @@ This script is a good starting point for a setup script to create site with some $currentNavigation = $currentNavigation | ConvertFrom-Json Write-host 'clearing old navigation links' foreach ($navigationItem in $currentNavigation) { - m365 spo navigation node remove --webUrl $siteUrl --location QuickLaunch --id $navigationItem.Id --confirm + m365 spo navigation node remove --webUrl $siteUrl --location QuickLaunch --id $navigationItem.Id --force } Write-host 'adding new navigation' $nodeAddedResponse = m365 spo navigation node add --webUrl $siteUrl --location QuickLaunch --title 'Sample Document Library' --url "/$siteRelativeUrl/$libName/Forms/AllItems.aspx" diff --git a/docs/docs/sample-scripts/spo/uninstall-package/index.mdx b/docs/docs/sample-scripts/spo/uninstall-package/index.mdx index 07631e376f9..05b7b6c8878 100644 --- a/docs/docs/sample-scripts/spo/uninstall-package/index.mdx +++ b/docs/docs/sample-scripts/spo/uninstall-package/index.mdx @@ -69,12 +69,12 @@ The purpose of this script is to uninstall .sppkg package from the specified app if ($app) { if ([string]::IsNullOrEmpty($appCatalogSiteUrl)) { - m365 spo app retract --id $app.ID --appCatalogUrl $url --confirm - m365 spo app remove --id $app.ID --appCatalogUrl $url --confirm + m365 spo app retract --id $app.ID --appCatalogUrl $url --force + m365 spo app remove --id $app.ID --appCatalogUrl $url --force } else { - m365 spo app retract --id $app.ID --appCatalogUrl $url --appCatalogScope sitecollection --confirm - m365 spo app remove --id $app.ID --appCatalogUrl $url --appCatalogScope sitecollection --confirm + m365 spo app retract --id $app.ID --appCatalogUrl $url --appCatalogScope sitecollection --force + m365 spo app remove --id $app.ID --appCatalogUrl $url --appCatalogScope sitecollection --force } Write-Host ("Package {0} successfully uninstalled from {1}." -f $packageName, $url) -ForegroundColor Green } diff --git a/docs/docs/sample-scripts/teams/create-team-and-add-members-and-owners/index.mdx b/docs/docs/sample-scripts/teams/create-team-and-add-members-and-owners/index.mdx index 576715166ca..86e970f80e0 100644 --- a/docs/docs/sample-scripts/teams/create-team-and-add-members-and-owners/index.mdx +++ b/docs/docs/sample-scripts/teams/create-team-and-add-members-and-owners/index.mdx @@ -87,7 +87,7 @@ This sample script shows you how to create a Team and add members and owners usi # remove yourself from the owners group if ($removeYourSelfFromOwners -and $owners.IndexOf($whoAmI.connectedAs) -eq -1) { Write-Host "Removing $($whoAmI.connectedAs) from the owners list" - m365 aad o365group user remove --groupId $group.id --userName $whoAmI.connectedAs --confirm + m365 aad o365group user remove --groupId $group.id --userName $whoAmI.connectedAs --force } Write-Host "Completed." diff --git a/docs/docs/sample-scripts/teams/remove-personal-app/index.mdx b/docs/docs/sample-scripts/teams/remove-personal-app/index.mdx index 869cd4c0567..9eae7379633 100644 --- a/docs/docs/sample-scripts/teams/remove-personal-app/index.mdx +++ b/docs/docs/sample-scripts/teams/remove-personal-app/index.mdx @@ -69,7 +69,7 @@ Uninstalls an app from the specified users and / or unpublish it from the Micros if ($userApp) { # Removing the app from the personal apps of the specified user - m365 teams user app remove --appId $userApp.id --userId $user.id --confirm + m365 teams user app remove --appId $userApp.id --userId $user.id --force Write-Host "The App '$($app.displayName)' with ID '$($app.id)' was removed for user '$($user.userPrincipalName)'." } else { @@ -81,7 +81,7 @@ Uninstalls an app from the specified users and / or unpublish it from the Micros if ($Unpublish) { # Removing the app from the app catalog - m365 teams app remove --id $app.id --confirm + m365 teams app remove --id $app.id --force Write-Host "The App '$($app.displayName)' with ID '$($app.id)' was removed from the app catalog." } } diff --git a/docs/docs/sample-scripts/teams/remove-wikitab-teams/index.mdx b/docs/docs/sample-scripts/teams/remove-wikitab-teams/index.mdx index cc16ccb1685..f866fd0dbcf 100644 --- a/docs/docs/sample-scripts/teams/remove-wikitab-teams/index.mdx +++ b/docs/docs/sample-scripts/teams/remove-wikitab-teams/index.mdx @@ -30,7 +30,7 @@ Removes the wiki tab of a Microsoft Teams Team's channel. if ($null -eq $tabs) { Write-Error "A Wiki tab was not found in the channel" } else { write-host "Removing wiki tab for the channel.." -ForegroundColor Green - m365 teams tab remove --teamId $groups[0].id --channelId $channels[0].id --id $tabs[0].id --confirm + m365 teams tab remove --teamId $groups[0].id --channelId $channels[0].id --id $tabs[0].id --force write-host " ...Done" -ForegroundColor Green } } @@ -67,7 +67,7 @@ Removes the wiki tab of a Microsoft Teams Team's channel. else tabId=$(echo $tabs | jq '.id') echo "Removing wiki tab for the channel.." - m365 teams tab remove --teamId $teamId --channelId $channelId --tabId $tabId --confirm + m365 teams tab remove --teamId $teamId --channelId $channelId --tabId $tabId --force echo "...Done" fi fi diff --git a/docs/docs/sample-scripts/tenant/monitor-notify-healthstatus/index.mdx b/docs/docs/sample-scripts/tenant/monitor-notify-healthstatus/index.mdx index 9eef72ad113..3d1821c7b80 100644 --- a/docs/docs/sample-scripts/tenant/monitor-notify-healthstatus/index.mdx +++ b/docs/docs/sample-scripts/tenant/monitor-notify-healthstatus/index.mdx @@ -91,7 +91,7 @@ If you want to schedule the script directly, you can go ahead without the need o Foreach ($Service in $currentOutageServices) { if ($Service.Workload -notin $workLoads.id) { #Removing the outage information from SharePoint List - $removedRecord = m365 spo listitem remove --webUrl $webURL --listTitle $listName --id $Service.Id --confirm + $removedRecord = m365 spo listitem remove --webUrl $webURL --listTitle $listName --id $Service.Id --force #Send notification using CLI Commands m365 outlook mail send --to $notifyEmail --subject "Outage RESOLVED for $($Service.Title)" --bodyContents "Outage which was reported for the Service : $($Service.Title) is RESOLVED." --bodyContentType HTML --saveToSentItems false diff --git a/docs/docs/sample-scripts/todo/cleanup-completed-todos/index.mdx b/docs/docs/sample-scripts/todo/cleanup-completed-todos/index.mdx index 8c78e4acc9d..4798dc3ba92 100644 --- a/docs/docs/sample-scripts/todo/cleanup-completed-todos/index.mdx +++ b/docs/docs/sample-scripts/todo/cleanup-completed-todos/index.mdx @@ -32,7 +32,7 @@ This script iterates across all of the task lists and removes the tasks that hav $tasks | ForEach-Object { Write-Output "Removing '$($_.Title)' task ..." - m365 todo task remove --listId $listId --id $_.Id --confirm + m365 todo task remove --listId $listId --id $_.Id --force } } @@ -59,7 +59,7 @@ This script iterates across all of the task lists and removes the tasks that hav echo "${strCount} completed tasks found ..." for strTaskId in "${arrTaskIds[@]}"; do echo "Removing '${strTaskId}' task ..." - m365 todo task remove --listId "${strlistId}" --id "$strTaskId" --confirm + m365 todo task remove --listId "${strlistId}" --id "$strTaskId" --force done done diff --git a/src/m365/aad/commands/app/app-remove.spec.ts b/src/m365/aad/commands/app/app-remove.spec.ts index d0b7ae87e29..afba766d2eb 100644 --- a/src/m365/aad/commands/app/app-remove.spec.ts +++ b/src/m365/aad/commands/app/app-remove.spec.ts @@ -186,7 +186,7 @@ describe(commands.APP_REMOVE, () => { await command.action(logger, { options: { appId: 'd75be2e1-0204-4f95-857d-51a37cf40be8', - confirm: true + force: true } }); assert(deleteRequestStub.called); @@ -196,7 +196,7 @@ describe(commands.APP_REMOVE, () => { await command.action(logger, { options: { objectId: 'd75be2e1-0204-4f95-857d-51a37cf40be8', - confirm: true + force: true } }); assert(deleteRequestStub.called); @@ -206,7 +206,7 @@ describe(commands.APP_REMOVE, () => { await command.action(logger, { options: { name: 'myapp', - confirm: true + force: true } }); assert(deleteRequestStub.called); @@ -221,7 +221,7 @@ describe(commands.APP_REMOVE, () => { throw "No Azure AD application registration with ID myapp found"; }); - await assert.rejects(command.action(logger, { options: { debug: true, appId: 'd75be2e1-0204-4f95-857d-51a37cf40be8', confirm: true } } as any), new CommandError("No Azure AD application registration with ID d75be2e1-0204-4f95-857d-51a37cf40be8 found")); + await assert.rejects(command.action(logger, { options: { debug: true, appId: 'd75be2e1-0204-4f95-857d-51a37cf40be8', force: true } } as any), new CommandError("No Azure AD application registration with ID d75be2e1-0204-4f95-857d-51a37cf40be8 found")); }); it('fails to get app by name when app does not exists', async () => { @@ -233,7 +233,7 @@ describe(commands.APP_REMOVE, () => { throw 'No Azure AD application registration with name myapp found'; }); - await assert.rejects(command.action(logger, { options: { debug: true, name: 'myapp', confirm: true } } as any), new CommandError("No Azure AD application registration with name myapp found")); + await assert.rejects(command.action(logger, { options: { debug: true, name: 'myapp', force: true } } as any), new CommandError("No Azure AD application registration with name myapp found")); }); it('fails when multiple apps with same name exists', async () => { @@ -260,7 +260,7 @@ describe(commands.APP_REMOVE, () => { options: { debug: true, name: 'myapp', - confirm: true + force: true } }), new CommandError("Multiple Azure AD application registration with name myapp found. Please choose one of the object IDs: d75be2e1-0204-4f95-857d-51a37cf40be8, 340a4aa3-1af6-43ac-87d8-189819003952")); }); diff --git a/src/m365/aad/commands/app/app-remove.ts b/src/m365/aad/commands/app/app-remove.ts index 53b647fa0b1..ec613e11208 100644 --- a/src/m365/aad/commands/app/app-remove.ts +++ b/src/m365/aad/commands/app/app-remove.ts @@ -15,7 +15,7 @@ export interface Options extends GlobalOptions { appId?: string; objectId?: string; name?: string; - confirm?: boolean; + force?: boolean; } class AadAppRemoveCommand extends GraphCommand { @@ -42,7 +42,7 @@ class AadAppRemoveCommand extends GraphCommand { appId: typeof args.options.appId !== 'undefined', objectId: typeof args.options.objectId !== 'undefined', name: typeof args.options.name !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -52,7 +52,7 @@ class AadAppRemoveCommand extends GraphCommand { { option: '--appId [appId]' }, { option: '--objectId [objectId]' }, { option: '--name [name]' }, - { option: '--confirm' } + { option: '-f, --force' } ); } @@ -100,7 +100,7 @@ class AadAppRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await deleteApp(); } else { diff --git a/src/m365/aad/commands/app/app-role-remove.spec.ts b/src/m365/aad/commands/app/app-role-remove.spec.ts index ba2db07982d..3d998718c8f 100644 --- a/src/m365/aad/commands/app/app-role-remove.spec.ts +++ b/src/m365/aad/commands/app/app-role-remove.spec.ts @@ -73,7 +73,7 @@ describe(commands.APP_ROLE_REMOVE, () => { assert.notStrictEqual(command.description, null); }); - it('deletes an app role when the role is in enabled state and valid appObjectId, role claim and --confirm option specified', async () => { + it('deletes an app role when the role is in enabled state and valid appObjectId, role claim and --force option specified', async () => { sinon.stub(request, 'get').callsFake(async opts => { if (opts.url === 'https://graph.microsoft.com/v1.0/myorganization/applications/5b31c38c-2584-42f0-aa47-657fb3a84230?$select=id,appRoles') { return { @@ -143,12 +143,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appObjectId: '5b31c38c-2584-42f0-aa47-657fb3a84230', claim: 'Product.Read', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in enabled state and valid appObjectId, role name and --confirm option specified', async () => { + it('deletes an app role when the role is in enabled state and valid appObjectId, role name and --force option specified', async () => { sinon.stub(request, 'get').callsFake(async opts => { if (opts.url === 'https://graph.microsoft.com/v1.0/myorganization/applications/5b31c38c-2584-42f0-aa47-657fb3a84230?$select=id,appRoles') { return { @@ -218,12 +218,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appObjectId: '5b31c38c-2584-42f0-aa47-657fb3a84230', name: 'ProductRead', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in enabled state and valid appObjectId, role id and --confirm option specified', async () => { + it('deletes an app role when the role is in enabled state and valid appObjectId, role id and --force option specified', async () => { sinon.stub(request, 'get').callsFake(async opts => { if (opts.url === 'https://graph.microsoft.com/v1.0/myorganization/applications/5b31c38c-2584-42f0-aa47-657fb3a84230?$select=id,appRoles') { return { @@ -293,12 +293,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appObjectId: '5b31c38c-2584-42f0-aa47-657fb3a84230', id: 'c4352a0a-494f-46f9-b843-479855c173a7', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in enabled state and valid appId, role claim and --confirm option specified', async () => { + it('deletes an app role when the role is in enabled state and valid appId, role claim and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -384,12 +384,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appId: '53788d97-dc06-460c-8bd6-5cfbc7e3b0f7', claim: 'Product.Read', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in enabled state and valid appId, role name and --confirm option specified', async () => { + it('deletes an app role when the role is in enabled state and valid appId, role name and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -476,12 +476,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appId: '53788d97-dc06-460c-8bd6-5cfbc7e3b0f7', name: 'ProductRead', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in enabled state and valid appId, role id and --confirm option specified', async () => { + it('deletes an app role when the role is in enabled state and valid appId, role id and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -566,12 +566,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appId: '53788d97-dc06-460c-8bd6-5cfbc7e3b0f7', id: 'c4352a0a-494f-46f9-b843-479855c173a7', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in enabled state and valid appObjectId, role claim and --confirm option specified (debug)', async () => { + it('deletes an app role when the role is in enabled state and valid appObjectId, role claim and --force option specified (debug)', async () => { sinon.stub(request, 'get').callsFake(async opts => { if (opts.url === 'https://graph.microsoft.com/v1.0/myorganization/applications/5b31c38c-2584-42f0-aa47-657fb3a84230?$select=id,appRoles') { return { @@ -642,12 +642,12 @@ describe(commands.APP_ROLE_REMOVE, () => { debug: true, appObjectId: '5b31c38c-2584-42f0-aa47-657fb3a84230', claim: 'Product.Read', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in enabled state and valid appId, role name and --confirm option specified (debug)', async () => { + it('deletes an app role when the role is in enabled state and valid appId, role name and --force option specified (debug)', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -735,12 +735,12 @@ describe(commands.APP_ROLE_REMOVE, () => { debug: true, appId: '53788d97-dc06-460c-8bd6-5cfbc7e3b0f7', name: 'ProductRead', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in enabled state and valid appId, role id and --confirm option specified (debug)', async () => { + it('deletes an app role when the role is in enabled state and valid appId, role id and --force option specified (debug)', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -826,12 +826,12 @@ describe(commands.APP_ROLE_REMOVE, () => { debug: true, appId: '53788d97-dc06-460c-8bd6-5cfbc7e3b0f7', id: 'c4352a0a-494f-46f9-b843-479855c173a7', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in "disabled" state and valid appId, role id and --confirm option specified', async () => { + it('deletes an app role when the role is in "disabled" state and valid appId, role id and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -904,12 +904,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appName: 'App-Name', id: 'c4352a0a-494f-46f9-b843-479855c173a7', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in "disabled" state and valid appId, role claim and --confirm option specified', async () => { + it('deletes an app role when the role is in "disabled" state and valid appId, role claim and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -982,12 +982,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appName: 'App-Name', claim: 'Product.Read', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in "disabled" state and valid appId, role name and --confirm option specified', async () => { + it('deletes an app role when the role is in "disabled" state and valid appId, role name and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -1060,12 +1060,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appName: 'App-Name', name: 'ProductRead', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in "disabled" state and valid appId, role id and --confirm option specified (debug)', async () => { + it('deletes an app role when the role is in "disabled" state and valid appId, role id and --force option specified (debug)', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -1139,12 +1139,12 @@ describe(commands.APP_ROLE_REMOVE, () => { debug: true, appName: 'App-Name', id: 'c4352a0a-494f-46f9-b843-479855c173a7', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in "disabled" state and valid appId, role claim and --confirm option specified (debug)', async () => { + it('deletes an app role when the role is in "disabled" state and valid appId, role claim and --force option specified (debug)', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -1218,12 +1218,12 @@ describe(commands.APP_ROLE_REMOVE, () => { debug: true, appName: 'App-Name', claim: 'Product.Read', - confirm: true + force: true } }); }); - it('deletes an app role when the role is in "disabled" state and valid appId, role name and --confirm option specified (debug)', async () => { + it('deletes an app role when the role is in "disabled" state and valid appId, role name and --force option specified (debug)', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -1297,12 +1297,12 @@ describe(commands.APP_ROLE_REMOVE, () => { debug: true, appName: 'App-Name', name: 'ProductRead', - confirm: true + force: true } }); }); - it('handles error when multiple apps with the specified appName found and --confirm option is specified', async () => { + it('handles error when multiple apps with the specified appName found and --force option is specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -1326,12 +1326,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appName: 'App-Name', claim: 'Product.Read', - confirm: true + force: true } }), new CommandError(`Multiple Azure AD application registration with name App-Name found. Please disambiguate using app object IDs: 5b31c38c-2584-42f0-aa47-657fb3a84230, a39c738c-939e-433b-930d-b02f2931a08b`)); }); - it('handles when multiple roles with the same name are found and --confirm option specified', async () => { + it('handles when multiple roles with the same name are found and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -1401,12 +1401,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appName: 'App-Name', name: 'ProductRead', - confirm: true + force: true } }), new CommandError(`Multiple roles with the provided 'name' were found. Please disambiguate using the claims : Product.Read, Product.Get`)); }); - it('handles when no roles with the specified name are found and --confirm option specified', async () => { + it('handles when no roles with the specified name are found and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -1439,12 +1439,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appName: 'App-Name', name: 'ProductRead', - confirm: true + force: true } }), new CommandError(`No app role with name 'ProductRead' found.`)); }); - it('handles when no roles with the specified claim are found and --confirm option specified', async () => { + it('handles when no roles with the specified claim are found and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -1477,12 +1477,12 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appName: 'App-Name', claim: 'Product.Read', - confirm: true + force: true } }), new CommandError(`No app role with claim 'Product.Read' found.`)); }); - it('handles when no roles with the specified id are found and --confirm option specified', async () => { + it('handles when no roles with the specified id are found and --force option specified', async () => { const getRequestStub = sinon.stub(request, 'get'); @@ -1515,7 +1515,7 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appName: 'App-Name', id: 'c4352a0a-494f-46f9-b843-479855c173a7', - confirm: true + force: true } }), new CommandError(`No app role with id 'c4352a0a-494f-46f9-b843-479855c173a7' found.`)); }); @@ -1618,7 +1618,7 @@ describe(commands.APP_ROLE_REMOVE, () => { debug: true, appObjectId: '5b31c38c-2584-42f0-aa47-657fb3a84230', claim: 'Product.Read', - confirm: false + force: false } }); }); @@ -1712,7 +1712,7 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appId: '53788d97-dc06-460c-8bd6-5cfbc7e3b0f7', name: 'ProductRead', - confirm: false + force: false } }); }); @@ -1806,7 +1806,7 @@ describe(commands.APP_ROLE_REMOVE, () => { debug: true, appId: '53788d97-dc06-460c-8bd6-5cfbc7e3b0f7', id: 'c4352a0a-494f-46f9-b843-479855c173a7', - confirm: false + force: false } }); }); @@ -1854,7 +1854,7 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appObjectId: '5b31c38c-2584-42f0-aa47-657fb3a84230', name: 'App-Role', - confirm: true + force: true } }), new CommandError(`Resource '5b31c38c-2584-42f0-aa47-657fb3a84230' does not exist or one of its queried reference-property objects are not present.`)); }); @@ -1872,7 +1872,7 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appId: '9b1b1e42-794b-4c71-93ac-5ed92488b67f', name: 'App-Role', - confirm: true + force: true } }), new CommandError(`No Azure AD application registration with ID 9b1b1e42-794b-4c71-93ac-5ed92488b67f found`)); }); @@ -1890,7 +1890,7 @@ describe(commands.APP_ROLE_REMOVE, () => { options: { appName: 'My app', name: 'App-Role', - confirm: true + force: true } }), new CommandError(`No Azure AD application registration with name My app found`)); }); diff --git a/src/m365/aad/commands/app/app-role-remove.ts b/src/m365/aad/commands/app/app-role-remove.ts index fb8037ce29b..6556380404c 100644 --- a/src/m365/aad/commands/app/app-role-remove.ts +++ b/src/m365/aad/commands/app/app-role-remove.ts @@ -60,7 +60,7 @@ class AadAppRoleRemoveCommand extends GraphCommand { { option: '-n, --name [name]' }, { option: '-i, --id [id]' }, { option: '-c, --claim [claim]' }, - { option: '--confirm' } + { option: '-f, --force' } ); } @@ -95,7 +95,7 @@ class AadAppRoleRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await deleteAppRole(); } else { diff --git a/src/m365/aad/commands/approleassignment/approleassignment-remove.spec.ts b/src/m365/aad/commands/approleassignment/approleassignment-remove.spec.ts index c88d676ca26..80ca49c6e71 100644 --- a/src/m365/aad/commands/approleassignment/approleassignment-remove.spec.ts +++ b/src/m365/aad/commands/approleassignment/approleassignment-remove.spec.ts @@ -132,32 +132,32 @@ describe(commands.APPROLEASSIGNMENT_REMOVE, () => { }); it('deletes app role assignments for service principal with specified displayName', async () => { - await command.action(logger, { options: { appDisplayName: 'myapp', resource: 'SharePoint', scope: 'Sites.Read.All', confirm: true } }); + await command.action(logger, { options: { appDisplayName: 'myapp', resource: 'SharePoint', scope: 'Sites.Read.All', force: true } }); assert(deleteRequestStub.called); }); it('deletes app role assignments for service principal with specified objectId and multiple scopes', async () => { - await command.action(logger, { options: { appObjectId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All,Sites.FullControl.All', confirm: true } }); + await command.action(logger, { options: { appObjectId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All,Sites.FullControl.All', force: true } }); assert(deleteRequestStub.calledTwice); }); it('deletes app role assignments for service principal with specified appId (debug)', async () => { - await command.action(logger, { options: { debug: true, appId: 'dc311e81-e099-4c64-bd66-c7183465f3f2', resource: 'SharePoint', scope: 'Sites.Read.All', confirm: true } }); + await command.action(logger, { options: { debug: true, appId: 'dc311e81-e099-4c64-bd66-c7183465f3f2', resource: 'SharePoint', scope: 'Sites.Read.All', force: true } }); assert(deleteRequestStub.called); }); it('handles intune alias for the resource option value', async () => { - await command.action(logger, { options: { debug: true, appId: 'dc311e81-e099-4c64-bd66-c7183465f3f2', resource: 'intune', scope: 'Sites.Read.All', confirm: true } }); + await command.action(logger, { options: { debug: true, appId: 'dc311e81-e099-4c64-bd66-c7183465f3f2', resource: 'intune', scope: 'Sites.Read.All', force: true } }); assert(deleteRequestStub.called); }); it('handles exchange alias for the resource option value', async () => { - await command.action(logger, { options: { debug: true, appId: 'dc311e81-e099-4c64-bd66-c7183465f3f2', resource: 'exchange', scope: 'Sites.Read.All', confirm: true } }); + await command.action(logger, { options: { debug: true, appId: 'dc311e81-e099-4c64-bd66-c7183465f3f2', resource: 'exchange', scope: 'Sites.Read.All', force: true } }); assert(deleteRequestStub.called); }); it('handles appId for the resource option value', async () => { - await command.action(logger, { options: { debug: true, appId: 'dc311e81-e099-4c64-bd66-c7183465f3f2', resource: 'fff194f1-7dce-4428-8301-1badb5518201', scope: 'Sites.Read.All', confirm: true } }); + await command.action(logger, { options: { debug: true, appId: 'dc311e81-e099-4c64-bd66-c7183465f3f2', resource: 'fff194f1-7dce-4428-8301-1badb5518201', scope: 'Sites.Read.All', force: true } }); assert(deleteRequestStub.called); }); @@ -175,7 +175,7 @@ describe(commands.APPROLEASSIGNMENT_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All', force: true } } as any), new CommandError(`Resource not found`)); }); @@ -193,7 +193,7 @@ describe(commands.APPROLEASSIGNMENT_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All', force: true } } as any), new CommandError(`The resource 'SharePoint' does not have any application permissions available.`)); }); @@ -211,7 +211,7 @@ describe(commands.APPROLEASSIGNMENT_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All', force: true } } as any), new CommandError(`The scope value 'Sites.Read.All' you have specified does not exist for SharePoint. ${os.EOL}Available scopes (application permissions) are: ${os.EOL}Scope1${os.EOL}Scope2`)); }); @@ -229,12 +229,12 @@ describe(commands.APPROLEASSIGNMENT_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.Read.All', force: true } } as any), new CommandError("app registration not found")); }); it('rejects if app role assignment is not found', async () => { - await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.ReadWrite.All', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, appId: '3e64c22f-3f14-4bce-a267-cb44c9a08e17', resource: 'SharePoint', scope: 'Sites.ReadWrite.All', force: true } } as any), new CommandError("App role assignment not found")); }); @@ -251,7 +251,7 @@ describe(commands.APPROLEASSIGNMENT_REMOVE, () => { } }); - await assert.rejects(command.action(logger, { options: { appId: '36e3a540-6f25-4483-9542-9f5fa00bb633', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { appId: '36e3a540-6f25-4483-9542-9f5fa00bb633', force: true } } as any), new CommandError(`Resource '' does not exist or one of its queried reference-property objects are not present`)); }); @@ -316,7 +316,7 @@ describe(commands.APPROLEASSIGNMENT_REMOVE, () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/aad/commands/approleassignment/approleassignment-remove.ts b/src/m365/aad/commands/approleassignment/approleassignment-remove.ts index 888bcd2bccf..e673bfec968 100644 --- a/src/m365/aad/commands/approleassignment/approleassignment-remove.ts +++ b/src/m365/aad/commands/approleassignment/approleassignment-remove.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { appObjectId?: string; resource: string; scope: string; - confirm?: boolean; + force?: boolean; } class AadAppRoleAssignmentRemoveCommand extends GraphCommand { @@ -46,7 +46,7 @@ class AadAppRoleAssignmentRemoveCommand extends GraphCommand { appId: typeof args.options.appId !== 'undefined', appDisplayName: typeof args.options.appDisplayName !== 'undefined', appObjectId: typeof args.options.appObjectId !== 'undefined', - confirm: (!!args.options.confirm).toString() + force: (!!args.options.force).toString() }); }); } @@ -70,7 +70,7 @@ class AadAppRoleAssignmentRemoveCommand extends GraphCommand { option: '-s, --scope ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -192,7 +192,7 @@ class AadAppRoleAssignmentRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeAppRoleAssignment(); } else { diff --git a/src/m365/aad/commands/groupsetting/groupsetting-remove.spec.ts b/src/m365/aad/commands/groupsetting/groupsetting-remove.spec.ts index d06bbabe433..cc39fb60fd1 100644 --- a/src/m365/aad/commands/groupsetting/groupsetting-remove.spec.ts +++ b/src/m365/aad/commands/groupsetting/groupsetting-remove.spec.ts @@ -80,7 +80,7 @@ describe(commands.GROUPSETTING_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: '28beab62-7540-4db1-a23f-29a6018a3848', confirm: true } }); + await command.action(logger, { options: { id: '28beab62-7540-4db1-a23f-29a6018a3848', force: true } }); assert(deleteRequestStub.called); }); @@ -93,7 +93,7 @@ describe(commands.GROUPSETTING_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, id: '28beab62-7540-4db1-a23f-29a6018a3848', confirm: true } }); + await command.action(logger, { options: { debug: true, id: '28beab62-7540-4db1-a23f-29a6018a3848', force: true } }); assert(deleteRequestStub.called); }); @@ -158,7 +158,7 @@ describe(commands.GROUPSETTING_REMOVE, () => { error: { 'odata.error': { message: { value: 'File Not Found.' } } } }); - await assert.rejects(command.action(logger, { options: { confirm: true, id: '28beab62-7540-4db1-a23f-29a6018a3848' } } as any), + await assert.rejects(command.action(logger, { options: { force: true, id: '28beab62-7540-4db1-a23f-29a6018a3848' } } as any), new CommandError('File Not Found.')); }); @@ -177,7 +177,7 @@ describe(commands.GROUPSETTING_REMOVE, () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/aad/commands/groupsetting/groupsetting-remove.ts b/src/m365/aad/commands/groupsetting/groupsetting-remove.ts index 23f63212e64..923ce475470 100644 --- a/src/m365/aad/commands/groupsetting/groupsetting-remove.ts +++ b/src/m365/aad/commands/groupsetting/groupsetting-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class AadGroupSettingRemoveCommand extends GraphCommand { @@ -35,7 +35,7 @@ class AadGroupSettingRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -46,7 +46,7 @@ class AadGroupSettingRemoveCommand extends GraphCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -84,7 +84,7 @@ class AadGroupSettingRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeGroupSetting(); } else { diff --git a/src/m365/aad/commands/o365group/o365group-recyclebinitem-clear.spec.ts b/src/m365/aad/commands/o365group/o365group-recyclebinitem-clear.spec.ts index bda34cfe21a..7f2c9a026dc 100644 --- a/src/m365/aad/commands/o365group/o365group-recyclebinitem-clear.spec.ts +++ b/src/m365/aad/commands/o365group/o365group-recyclebinitem-clear.spec.ts @@ -68,7 +68,7 @@ describe(commands.O365GROUP_RECYCLEBINITEM_CLEAR, () => { assert.notStrictEqual(command.description, null); }); - it('clears the recycle bin items without prompting for confirmation when --confirm option specified', async () => { + it('clears the recycle bin items without prompting for confirmation when --force option specified', async () => { const deleteStub = sinon.stub(request, 'delete').resolves(); // Stub representing the get deleted items operation @@ -132,11 +132,11 @@ describe(commands.O365GROUP_RECYCLEBINITEM_CLEAR, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { confirm: true } }); + await command.action(logger, { options: { force: true } }); assert(deleteStub.calledTwice); }); - it('clears the recycle bin items when deleted items data is served in pages and --confirm option specified', async () => { + it('clears the recycle bin items when deleted items data is served in pages and --force option specified', async () => { const deleteStub = sinon.stub(request, 'delete').resolves(); // Stub representing the get deleted items operation @@ -234,7 +234,7 @@ describe(commands.O365GROUP_RECYCLEBINITEM_CLEAR, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { confirm: true } }); + await command.action(logger, { options: { force: true } }); assert(deleteStub.calledThrice); }); @@ -250,11 +250,11 @@ describe(commands.O365GROUP_RECYCLEBINITEM_CLEAR, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { confirm: true } }); + await command.action(logger, { options: { force: true } }); assert(deleteStub.notCalled); }); - it('prompts before clearing the O365 Group recycle bin items when --confirm option is not passed', async () => { + it('prompts before clearing the O365 Group recycle bin items when --force option is not passed', async () => { await command.action(logger, { options: {} }); let promptIssued = false; @@ -459,14 +459,14 @@ describe(commands.O365GROUP_RECYCLEBINITEM_CLEAR, () => { const errorMessage = 'Something went wrong'; sinon.stub(request, 'get').rejects(new Error(errorMessage)); - await assert.rejects(command.action(logger, { options: { confirm: true } }), new CommandError(errorMessage)); + await assert.rejects(command.action(logger, { options: { force: true } }), new CommandError(errorMessage)); }); it('supports specifying confirmation flag', () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/aad/commands/o365group/o365group-recyclebinitem-clear.ts b/src/m365/aad/commands/o365group/o365group-recyclebinitem-clear.ts index 97a8c035cb9..5fd50e4233d 100644 --- a/src/m365/aad/commands/o365group/o365group-recyclebinitem-clear.ts +++ b/src/m365/aad/commands/o365group/o365group-recyclebinitem-clear.ts @@ -12,7 +12,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; } class AadO365GroupRecycleBinItemClearCommand extends GraphCommand { @@ -34,7 +34,7 @@ class AadO365GroupRecycleBinItemClearCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: typeof args.options.confirm !== 'undefined' + force: typeof args.options.force !== 'undefined' }); }); } @@ -42,7 +42,7 @@ class AadO365GroupRecycleBinItemClearCommand extends GraphCommand { #initOptions(): void { this.options.unshift( { - option: '--confirm' + option: '-f, --force' } ); } @@ -57,7 +57,7 @@ class AadO365GroupRecycleBinItemClearCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await clearO365GroupRecycleBinItems(); } else { diff --git a/src/m365/aad/commands/o365group/o365group-recyclebinitem-remove.spec.ts b/src/m365/aad/commands/o365group/o365group-recyclebinitem-remove.spec.ts index 6d4bd1760a6..b004337a033 100644 --- a/src/m365/aad/commands/o365group/o365group-recyclebinitem-remove.spec.ts +++ b/src/m365/aad/commands/o365group/o365group-recyclebinitem-remove.spec.ts @@ -165,7 +165,7 @@ describe(commands.O365GROUP_RECYCLEBINITEM_REMOVE, () => { await assert.rejects(command.action(logger, { options: { mailNickname: validGroupMailNickname, - confirm: true + force: true } }), new CommandError(`The specified group '${validGroupMailNickname}' does not exist.`)); }); @@ -182,7 +182,7 @@ describe(commands.O365GROUP_RECYCLEBINITEM_REMOVE, () => { await assert.rejects(command.action(logger, { options: { mailNickname: validGroupMailNickname, - confirm: true + force: true } }), new CommandError(`Multiple groups with name '${validGroupMailNickname}' found: ${multipleGroupsResponse.value.map(x => x.id).join(',')}.`)); }); @@ -199,7 +199,7 @@ describe(commands.O365GROUP_RECYCLEBINITEM_REMOVE, () => { await command.action(logger, { options: { id: validGroupId, - confirm: true + force: true } }); }); @@ -281,7 +281,7 @@ describe(commands.O365GROUP_RECYCLEBINITEM_REMOVE, () => { await assert.rejects(command.action(logger, { options: { id: validGroupId, - confirm: true + force: true } }), new CommandError("An error has occurred")); }); diff --git a/src/m365/aad/commands/o365group/o365group-recyclebinitem-remove.ts b/src/m365/aad/commands/o365group/o365group-recyclebinitem-remove.ts index 5528ea72459..49891e6ebdd 100644 --- a/src/m365/aad/commands/o365group/o365group-recyclebinitem-remove.ts +++ b/src/m365/aad/commands/o365group/o365group-recyclebinitem-remove.ts @@ -16,7 +16,7 @@ interface Options extends GlobalOptions { id?: string; displayName?: string; mailNickname?: string; - confirm: boolean; + force: boolean; } class AadO365GroupRecycleBinItemRemoveCommand extends GraphCommand { @@ -43,7 +43,7 @@ class AadO365GroupRecycleBinItemRemoveCommand extends GraphCommand { id: typeof args.options.id !== 'undefined', displayName: typeof args.options.displayName !== 'undefined', mailNickname: typeof args.options.mailNickname !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -60,7 +60,7 @@ class AadO365GroupRecycleBinItemRemoveCommand extends GraphCommand { option: '-m, --mailNickname [mailNickname]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -101,7 +101,7 @@ class AadO365GroupRecycleBinItemRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeGroup(); } else { diff --git a/src/m365/aad/commands/o365group/o365group-recyclebinitem-restore.spec.ts b/src/m365/aad/commands/o365group/o365group-recyclebinitem-restore.spec.ts index 4bebaf5f0c3..d773e9a269f 100644 --- a/src/m365/aad/commands/o365group/o365group-recyclebinitem-restore.spec.ts +++ b/src/m365/aad/commands/o365group/o365group-recyclebinitem-restore.spec.ts @@ -199,7 +199,7 @@ describe(commands.O365GROUP_RECYCLEBINITEM_RESTORE, () => { await assert.rejects(command.action(logger, { options: { mailNickname: validGroupMailNickname, - confirm: true + force: true } }), new CommandError(`The specified group '${validGroupMailNickname}' does not exist.`)); }); @@ -216,7 +216,7 @@ describe(commands.O365GROUP_RECYCLEBINITEM_RESTORE, () => { await assert.rejects(command.action(logger, { options: { mailNickname: validGroupMailNickname, - confirm: true + force: true } }), new CommandError(`Multiple groups with name '${validGroupMailNickname}' found: ${multipleGroupsResponse.value.map(x => x.id).join(',')}.`)); }); diff --git a/src/m365/aad/commands/o365group/o365group-remove.spec.ts b/src/m365/aad/commands/o365group/o365group-remove.spec.ts index a57b3d0cb0b..fa296c0ede8 100644 --- a/src/m365/aad/commands/o365group/o365group-remove.spec.ts +++ b/src/m365/aad/commands/o365group/o365group-remove.spec.ts @@ -80,7 +80,7 @@ describe(commands.O365GROUP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: '28beab62-7540-4db1-a23f-29a6018a3848', confirm: false } }); + await command.action(logger, { options: { id: '28beab62-7540-4db1-a23f-29a6018a3848', force: false } }); assert(loggerLogSpy.notCalled); }); @@ -93,7 +93,7 @@ describe(commands.O365GROUP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, id: '28beab62-7540-4db1-a23f-29a6018a3848', confirm: false } }); + await command.action(logger, { options: { debug: true, id: '28beab62-7540-4db1-a23f-29a6018a3848', force: false } }); assert(loggerLogSpy.notCalled); }); @@ -192,14 +192,14 @@ describe(commands.O365GROUP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, id: '28beab62-7540-4db1-a23f-29a6018a3848', skipRecycleBin: true, confirm: true } }); + await command.action(logger, { options: { debug: true, id: '28beab62-7540-4db1-a23f-29a6018a3848', skipRecycleBin: true, force: true } }); assert(groupPermDeleteCallIssued); }); it('correctly handles error when group is not found', async () => { sinon.stub(request, 'delete').rejects({ error: { 'odata.error': { message: { value: 'File Not Found.' } } } }); - await assert.rejects(command.action(logger, { options: { confirm: true, id: '28beab62-7540-4db1-a23f-29a6018a3848' } } as any), + await assert.rejects(command.action(logger, { options: { force: true, id: '28beab62-7540-4db1-a23f-29a6018a3848' } } as any), new CommandError('File Not Found.')); }); @@ -218,7 +218,7 @@ describe(commands.O365GROUP_REMOVE, () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/aad/commands/o365group/o365group-remove.ts b/src/m365/aad/commands/o365group/o365group-remove.ts index 7c141b56cfa..979794ddc20 100644 --- a/src/m365/aad/commands/o365group/o365group-remove.ts +++ b/src/m365/aad/commands/o365group/o365group-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; skipRecycleBin: boolean; } @@ -36,7 +36,7 @@ class AadO365GroupRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString(), + force: (!(!args.options.force)).toString(), skipRecycleBin: args.options.skipRecycleBin }); }); @@ -48,7 +48,7 @@ class AadO365GroupRemoveCommand extends GraphCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' }, { option: '--skipRecycleBin' @@ -99,7 +99,7 @@ class AadO365GroupRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeGroup(); } else { diff --git a/src/m365/aad/commands/o365group/o365group-user-remove.spec.ts b/src/m365/aad/commands/o365group/o365group-user-remove.spec.ts index 55c8dbd5cd8..07b09c4a903 100644 --- a/src/m365/aad/commands/o365group/o365group-user-remove.spec.ts +++ b/src/m365/aad/commands/o365group/o365group-user-remove.spec.ts @@ -268,7 +268,7 @@ describe(commands.O365GROUP_USER_REMOVE, () => { }); - await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", confirm: true } }); + await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", force: true } }); assert(memberDeleteCallIssued); }); @@ -318,7 +318,7 @@ describe(commands.O365GROUP_USER_REMOVE, () => { }); - await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", confirm: true } }); + await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", force: true } }); assert(memberDeleteCallIssued); }); @@ -368,7 +368,7 @@ describe(commands.O365GROUP_USER_REMOVE, () => { }); - await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", confirm: true } }); + await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", force: true } }); assert(memberDeleteCallIssued); }); @@ -421,7 +421,7 @@ describe(commands.O365GROUP_USER_REMOVE, () => { }); - await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", confirm: true } }); + await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", force: true } }); assert(memberDeleteCallIssued); }); @@ -474,7 +474,7 @@ describe(commands.O365GROUP_USER_REMOVE, () => { }); - await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", confirm: true } }); + await command.action(logger, { options: { groupId: "00000000-0000-0000-0000-000000000000", userName: "anne.matthews@contoso.onmicrosoft.com", force: true } }); assert(memberDeleteCallIssued); }); diff --git a/src/m365/aad/commands/o365group/o365group-user-remove.ts b/src/m365/aad/commands/o365group/o365group-user-remove.ts index 765c8279a79..5069f242cb4 100644 --- a/src/m365/aad/commands/o365group/o365group-user-remove.ts +++ b/src/m365/aad/commands/o365group/o365group-user-remove.ts @@ -20,7 +20,7 @@ interface Options extends GlobalOptions { teamId?: string; groupId?: string; userName: string; - confirm?: boolean; + force?: boolean; } class AadO365GroupUserRemoveCommand extends GraphCommand { @@ -48,7 +48,7 @@ class AadO365GroupUserRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString(), + force: (!(!args.options.force)).toString(), teamId: typeof args.options.teamId !== 'undefined', groupId: typeof args.options.groupId !== 'undefined' }); @@ -67,7 +67,7 @@ class AadO365GroupUserRemoveCommand extends GraphCommand { option: '-n, --userName ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -151,7 +151,7 @@ class AadO365GroupUserRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeUser(); } else { diff --git a/src/m365/aad/commands/oauth2grant/oauth2grant-remove.spec.ts b/src/m365/aad/commands/oauth2grant/oauth2grant-remove.spec.ts index 8a1fe364e6a..98212614136 100644 --- a/src/m365/aad/commands/oauth2grant/oauth2grant-remove.spec.ts +++ b/src/m365/aad/commands/oauth2grant/oauth2grant-remove.spec.ts @@ -112,7 +112,7 @@ describe(commands.OAUTH2GRANT_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { grantId: 'YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek', confirm: true } }); + await command.action(logger, { options: { grantId: 'YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek', force: true } }); assert(loggerLogSpy.notCalled); assert(deleteRequestStub.called); }); @@ -175,7 +175,7 @@ describe(commands.OAUTH2GRANT_REMOVE, () => { }); }); - await assert.rejects(command.action(logger, { options: { confirm: true, grantId: 'YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek' } } as any), + await assert.rejects(command.action(logger, { options: { force: true, grantId: 'YgA60KYa4UOPSdc-lpxYEnQkr8KVLDpCsOXkiV8i-ek' } } as any), new CommandError('An error has occurred')); }); @@ -194,7 +194,7 @@ describe(commands.OAUTH2GRANT_REMOVE, () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/aad/commands/oauth2grant/oauth2grant-remove.ts b/src/m365/aad/commands/oauth2grant/oauth2grant-remove.ts index db5b5c11571..7af5c4ced82 100644 --- a/src/m365/aad/commands/oauth2grant/oauth2grant-remove.ts +++ b/src/m365/aad/commands/oauth2grant/oauth2grant-remove.ts @@ -35,7 +35,7 @@ class AadOAuth2GrantRemoveCommand extends GraphCommand { option: '-i, --grantId ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -62,7 +62,7 @@ class AadOAuth2GrantRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeOauth2Grant(); } else { diff --git a/src/m365/aad/commands/siteclassification/siteclassification-disable.spec.ts b/src/m365/aad/commands/siteclassification/siteclassification-disable.spec.ts index a6de8fcd111..9268610851c 100644 --- a/src/m365/aad/commands/siteclassification/siteclassification-disable.spec.ts +++ b/src/m365/aad/commands/siteclassification/siteclassification-disable.spec.ts @@ -87,7 +87,7 @@ describe(commands.SITECLASSIFICATION_DISABLE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, force: true } } as any), new CommandError('Site classification is not enabled.')); }); @@ -162,7 +162,7 @@ describe(commands.SITECLASSIFICATION_DISABLE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, force: true } } as any), new CommandError("Missing DirectorySettingTemplate for \"Group.Unified\"")); }); @@ -237,7 +237,7 @@ describe(commands.SITECLASSIFICATION_DISABLE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, force: true } } as any), new CommandError("Missing UnifiedGroupSettting id")); }); @@ -312,7 +312,7 @@ describe(commands.SITECLASSIFICATION_DISABLE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, force: true } } as any), new CommandError("Missing UnifiedGroupSettting id")); }); @@ -397,7 +397,7 @@ describe(commands.SITECLASSIFICATION_DISABLE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { confirm: true } } as any); + await command.action(logger, { options: { force: true } } as any); assert(deleteRequestIssued); }); @@ -482,7 +482,7 @@ describe(commands.SITECLASSIFICATION_DISABLE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, confirm: true } } as any); + await command.action(logger, { options: { debug: true, force: true } } as any); assert(deleteRequestIssued); }); diff --git a/src/m365/aad/commands/siteclassification/siteclassification-disable.ts b/src/m365/aad/commands/siteclassification/siteclassification-disable.ts index 7b06107f41d..40b0937c5d1 100644 --- a/src/m365/aad/commands/siteclassification/siteclassification-disable.ts +++ b/src/m365/aad/commands/siteclassification/siteclassification-disable.ts @@ -11,7 +11,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; } class AadSiteClassificationDisableCommand extends GraphCommand { @@ -33,7 +33,7 @@ class AadSiteClassificationDisableCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -41,7 +41,7 @@ class AadSiteClassificationDisableCommand extends GraphCommand { #initOptions(): void { this.options.unshift( { - option: '--confirm' + option: '-f, --force' } ); } @@ -91,7 +91,7 @@ class AadSiteClassificationDisableCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await disableSiteClassification(); } else { diff --git a/src/m365/aad/commands/user/user-license-remove.spec.ts b/src/m365/aad/commands/user/user-license-remove.spec.ts index 8f4de043122..ef487016471 100644 --- a/src/m365/aad/commands/user/user-license-remove.spec.ts +++ b/src/m365/aad/commands/user/user-license-remove.spec.ts @@ -151,7 +151,7 @@ describe(commands.USER_LICENSE_REMOVE, () => { throw `Invalid request ${opts.url}`; }); - await command.action(logger, { options: { userId: validUserId, ids: validIdsSingle, confirm: true } }); + await command.action(logger, { options: { userId: validUserId, ids: validIdsSingle, force: true } }); assert(postSpy.called); }); @@ -186,7 +186,7 @@ describe(commands.USER_LICENSE_REMOVE, () => { await command.action(logger, { options: { - verbose: true, userId: validUserId, ids: validIds, confirm: true + verbose: true, userId: validUserId, ids: validIds, force: true } }); assert(postSpy.called); @@ -209,7 +209,7 @@ describe(commands.USER_LICENSE_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - verbose: true, userId: validUserId, ids: validIdsSingle, confirm: true + verbose: true, userId: validUserId, ids: validIdsSingle, force: true } }), new CommandError(error.error.message)); }); @@ -224,7 +224,7 @@ describe(commands.USER_LICENSE_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - userName: validUserName, ids: validIds, confirm: true + userName: validUserName, ids: validIds, force: true } }), new CommandError(error.error.message)); }); diff --git a/src/m365/aad/commands/user/user-license-remove.ts b/src/m365/aad/commands/user/user-license-remove.ts index cca5dcd79b4..565635a3c90 100644 --- a/src/m365/aad/commands/user/user-license-remove.ts +++ b/src/m365/aad/commands/user/user-license-remove.ts @@ -14,7 +14,7 @@ interface Options extends GlobalOptions { userId?: string; userName?: string; ids: string; - confirm?: boolean; + force?: boolean; } class AadUserLicenseRemoveCommand extends GraphCommand { @@ -41,7 +41,7 @@ class AadUserLicenseRemoveCommand extends GraphCommand { Object.assign(this.telemetryProperties, { userId: typeof args.options.userId !== 'undefined', userName: typeof args.options.userName !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -58,7 +58,7 @@ class AadUserLicenseRemoveCommand extends GraphCommand { option: '--ids ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -94,7 +94,7 @@ class AadUserLicenseRemoveCommand extends GraphCommand { logger.logToStderr(`Removing the licenses for the user '${args.options.userId || args.options.userName}'...`); } - if (args.options.confirm) { + if (args.options.force) { await this.deleteUserLicenses(args); } else { diff --git a/src/m365/aad/commands/user/user-recyclebinitem-clear.spec.ts b/src/m365/aad/commands/user/user-recyclebinitem-clear.spec.ts index 3eb583e6855..61387d0b6e9 100644 --- a/src/m365/aad/commands/user/user-recyclebinitem-clear.spec.ts +++ b/src/m365/aad/commands/user/user-recyclebinitem-clear.spec.ts @@ -118,7 +118,7 @@ describe(commands.USER_RECYCLEBINITEM_CLEAR, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { confirm: true, verbose: true } }); + await command.action(logger, { options: { force: true, verbose: true } }); assert.strictEqual(amountOfBatches, 3); }); @@ -157,7 +157,7 @@ describe(commands.USER_RECYCLEBINITEM_CLEAR, () => { } }); - await assert.rejects(command.action(logger, { options: { confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { force: true } } as any), new CommandError('An error has occured while processing this request.')); }); }); diff --git a/src/m365/aad/commands/user/user-recyclebinitem-clear.ts b/src/m365/aad/commands/user/user-recyclebinitem-clear.ts index e90ac508a08..67a86b33b7d 100644 --- a/src/m365/aad/commands/user/user-recyclebinitem-clear.ts +++ b/src/m365/aad/commands/user/user-recyclebinitem-clear.ts @@ -12,7 +12,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; } class AadUserRecycleBinItemClearCommand extends GraphCommand { @@ -34,7 +34,7 @@ class AadUserRecycleBinItemClearCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -42,7 +42,7 @@ class AadUserRecycleBinItemClearCommand extends GraphCommand { #initOptions(): void { this.options.unshift( { - option: '--confirm' + option: '-f, --force' } ); } @@ -86,7 +86,7 @@ class AadUserRecycleBinItemClearCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await clearRecycleBinUsers(); } else { diff --git a/src/m365/aad/commands/user/user-recyclebinitem-list.spec.ts b/src/m365/aad/commands/user/user-recyclebinitem-list.spec.ts index 053a9675cad..436f184dcd4 100644 --- a/src/m365/aad/commands/user/user-recyclebinitem-list.spec.ts +++ b/src/m365/aad/commands/user/user-recyclebinitem-list.spec.ts @@ -90,7 +90,7 @@ describe(commands.USER_RECYCLEBINITEM_LIST, () => { } }); - await assert.rejects(command.action(logger, { options: { confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { force: true } } as any), new CommandError('An error has occured while processing this request.')); }); }); \ No newline at end of file diff --git a/src/m365/aad/commands/user/user-recyclebinitem-remove.spec.ts b/src/m365/aad/commands/user/user-recyclebinitem-remove.spec.ts index b359b5b74b8..b25a003affd 100644 --- a/src/m365/aad/commands/user/user-recyclebinitem-remove.spec.ts +++ b/src/m365/aad/commands/user/user-recyclebinitem-remove.spec.ts @@ -94,7 +94,7 @@ describe(commands.USER_RECYCLEBINITEM_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: validUserId, confirm: true, verbose: true } }); + await command.action(logger, { options: { id: validUserId, force: true, verbose: true } }); assert(deleteStub.called); }); @@ -131,7 +131,7 @@ describe(commands.USER_RECYCLEBINITEM_REMOVE, () => { } }); - await assert.rejects(command.action(logger, { options: { confirm: true, id: validUserId } } as any), + await assert.rejects(command.action(logger, { options: { force: true, id: validUserId } } as any), new CommandError(`Resource '${validUserId}' does not exist or one of its queried reference-property objects are not present.`)); }); diff --git a/src/m365/aad/commands/user/user-recyclebinitem-remove.ts b/src/m365/aad/commands/user/user-recyclebinitem-remove.ts index a00d218c9a9..1e31228352e 100644 --- a/src/m365/aad/commands/user/user-recyclebinitem-remove.ts +++ b/src/m365/aad/commands/user/user-recyclebinitem-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class AadUserRecycleBinItemRemoveCommand extends GraphCommand { @@ -35,7 +35,7 @@ class AadUserRecycleBinItemRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -46,7 +46,7 @@ class AadUserRecycleBinItemRemoveCommand extends GraphCommand { option: '--id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -81,7 +81,7 @@ class AadUserRecycleBinItemRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await clearRecycleBinItem(); } else { diff --git a/src/m365/aad/commands/user/user-remove.spec.ts b/src/m365/aad/commands/user/user-remove.spec.ts index ad181eda463..1b4d74b164d 100644 --- a/src/m365/aad/commands/user/user-remove.spec.ts +++ b/src/m365/aad/commands/user/user-remove.spec.ts @@ -182,7 +182,7 @@ describe(commands.USER_REMOVE, () => { options: { verbose: true, userName: validUsername, - confirm: true + force: true } }); assert(deleteStub.called); @@ -201,7 +201,7 @@ describe(commands.USER_REMOVE, () => { options: { verbose: true, id: validId, - confirm: true + force: true } }), new CommandError(error.error.message)); }); diff --git a/src/m365/aad/commands/user/user-remove.ts b/src/m365/aad/commands/user/user-remove.ts index 35fba9fe681..8c94951369d 100644 --- a/src/m365/aad/commands/user/user-remove.ts +++ b/src/m365/aad/commands/user/user-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id?: string; userName?: string; - confirm?: boolean; + force?: boolean; } class AadUserRemoveCommand extends GraphCommand { @@ -40,7 +40,7 @@ class AadUserRemoveCommand extends GraphCommand { Object.assign(this.telemetryProperties, { id: typeof args.options.id !== 'undefined', userName: typeof args.options.userName !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -54,7 +54,7 @@ class AadUserRemoveCommand extends GraphCommand { option: '--userName [userName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -86,7 +86,7 @@ class AadUserRemoveCommand extends GraphCommand { logger.logToStderr(`Removing user '${args.options.id || args.options.userName}'...`); } - if (args.options.confirm) { + if (args.options.force) { await this.deleteUser(args); } else { diff --git a/src/m365/context/commands/context-remove.spec.ts b/src/m365/context/commands/context-remove.spec.ts index 8e6c25a1661..3275bcb3d83 100644 --- a/src/m365/context/commands/context-remove.spec.ts +++ b/src/m365/context/commands/context-remove.spec.ts @@ -81,7 +81,7 @@ describe(commands.REMOVE, () => { context: {} })); const unlinkSyncStub = sinon.stub(fs, 'unlinkSync').callsFake(_ => { }); - await command.action(logger, { options: { debug: true, confirm: true } }); + await command.action(logger, { options: { debug: true, force: true } }); assert(unlinkSyncStub.called); }); @@ -127,7 +127,7 @@ describe(commands.REMOVE, () => { sinon.stub(fs, 'existsSync').callsFake(_ => true); sinon.stub(fs, 'readFileSync').callsFake(_ => { throw new Error('An error has occurred'); }); - await assert.rejects(command.action(logger, { options: { debug: true, confirm: true } }), new CommandError(`Error reading .m365rc.json: Error: An error has occurred. Please remove context info from .m365rc.json manually.`)); + await assert.rejects(command.action(logger, { options: { debug: true, force: true } }), new CommandError(`Error reading .m365rc.json: Error: An error has occurred. Please remove context info from .m365rc.json manually.`)); }); it(`handles an error when writing file contents fails`, async () => { @@ -143,7 +143,7 @@ describe(commands.REMOVE, () => { })); sinon.stub(fs, 'writeFileSync').callsFake(_ => { throw new Error('An error has occurred'); }); - await assert.rejects(command.action(logger, { options: { debug: true, confirm: true } }), new CommandError(`Error writing .m365rc.json: Error: An error has occurred. Please remove context info from .m365rc.json manually.`)); + await assert.rejects(command.action(logger, { options: { debug: true, force: true } }), new CommandError(`Error writing .m365rc.json: Error: An error has occurred. Please remove context info from .m365rc.json manually.`)); }); it(`handles an error when removing the file fails`, async () => { @@ -152,7 +152,7 @@ describe(commands.REMOVE, () => { "context": {} })); sinon.stub(fs, 'unlinkSync').callsFake(_ => { throw new Error('An error has occurred'); }); - await assert.rejects(command.action(logger, { options: { debug: true, confirm: true } }), new CommandError(`Error removing .m365rc.json: Error: An error has occurred. Please remove .m365rc.json manually.`)); + await assert.rejects(command.action(logger, { options: { debug: true, force: true } }), new CommandError(`Error removing .m365rc.json: Error: An error has occurred. Please remove .m365rc.json manually.`)); }); it(`doesn't update the context file, if it doesn't contain context information`, async () => { @@ -165,7 +165,7 @@ describe(commands.REMOVE, () => { })); const fsWriteFileSyncSpy = sinon.spy(fs, 'writeFileSync'); - await command.action(logger, { options: { debug: true, confirm: true } }); + await command.action(logger, { options: { debug: true, force: true } }); assert(fsWriteFileSyncSpy.notCalled); }); }); \ No newline at end of file diff --git a/src/m365/context/commands/context-remove.ts b/src/m365/context/commands/context-remove.ts index 8f57def60c2..ff3bf042019 100644 --- a/src/m365/context/commands/context-remove.ts +++ b/src/m365/context/commands/context-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; } class ContextRemoveCommand extends AnonymousCommand { @@ -34,7 +34,7 @@ class ContextRemoveCommand extends AnonymousCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -42,13 +42,13 @@ class ContextRemoveCommand extends AnonymousCommand { #initOptions(): void { this.options.unshift( { - option: '--confirm' + option: '-f, --force' } ); } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeContext(); } else { diff --git a/src/m365/context/commands/option/option-list.spec.ts b/src/m365/context/commands/option/option-list.spec.ts index 6d1eeb08d0c..ef620b3c5fa 100644 --- a/src/m365/context/commands/option/option-list.spec.ts +++ b/src/m365/context/commands/option/option-list.spec.ts @@ -88,7 +88,7 @@ describe(commands.OPTION_LIST, () => { ] })); - await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', confirm: true } }), new CommandError(`No context present`)); + await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', force: true } }), new CommandError(`No context present`)); }); }); \ No newline at end of file diff --git a/src/m365/context/commands/option/option-remove.spec.ts b/src/m365/context/commands/option/option-remove.spec.ts index aa476324075..2aa6e576607 100644 --- a/src/m365/context/commands/option/option-remove.spec.ts +++ b/src/m365/context/commands/option/option-remove.spec.ts @@ -78,7 +78,7 @@ describe(commands.OPTION_REMOVE, () => { sinon.stub(fs, 'existsSync').callsFake(_ => true); sinon.stub(fs, 'readFileSync').callsFake(_ => { throw new Error('An error has occurred'); }); - await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', confirm: true } }), new CommandError(`Error reading .m365rc.json: Error: An error has occurred. Please remove context option listName from .m365rc.json manually.`)); + await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', force: true } }), new CommandError(`Error reading .m365rc.json: Error: An error has occurred. Please remove context option listName from .m365rc.json manually.`)); }); it('handles an error when writing file contents fails', async () => { @@ -96,7 +96,7 @@ describe(commands.OPTION_REMOVE, () => { })); sinon.stub(fs, 'writeFileSync').callsFake(_ => { throw new Error('An error has occurred'); }); - await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', confirm: true } }), new CommandError(`Error writing .m365rc.json: Error: An error has occurred. Please remove context option listName from .m365rc.json manually.`)); + await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', force: true } }), new CommandError(`Error writing .m365rc.json: Error: An error has occurred. Please remove context option listName from .m365rc.json manually.`)); }); it(`removes a context info option from the existing .m365rc.json file`, async () => { @@ -136,7 +136,7 @@ describe(commands.OPTION_REMOVE, () => { } })); - await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', confirm: true } }), new CommandError(`There is no option listName in the context info`)); + await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', force: true } }), new CommandError(`There is no option listName in the context info`)); }); it('handles an error when context is not present in the .m365rc.json file', async () => { @@ -150,7 +150,7 @@ describe(commands.OPTION_REMOVE, () => { ] })); - await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', confirm: true } }), new CommandError(`There is no option listName in the context info`)); + await assert.rejects(command.action(logger, { options: { debug: true, name: 'listName', force: true } }), new CommandError(`There is no option listName in the context info`)); }); }); \ No newline at end of file diff --git a/src/m365/context/commands/option/option-remove.ts b/src/m365/context/commands/option/option-remove.ts index d610b17903f..85562b823f1 100644 --- a/src/m365/context/commands/option/option-remove.ts +++ b/src/m365/context/commands/option/option-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { name: string; - confirm?: boolean; + force?: boolean; } class ContextOptionRemoveCommand extends ContextCommand { @@ -35,7 +35,7 @@ class ContextOptionRemoveCommand extends ContextCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -46,7 +46,7 @@ class ContextOptionRemoveCommand extends ContextCommand { option: '-n, --name ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -56,7 +56,7 @@ class ContextOptionRemoveCommand extends ContextCommand { logger.logToStderr(`Removing context option '${args.options.name}'...`); } - if (args.options.confirm) { + if (args.options.force) { this.removeContextOption(args.options.name, logger); } else { diff --git a/src/m365/file/commands/file-list.ts b/src/m365/file/commands/file-list.ts index f96a23cdace..adc3b9d5d65 100644 --- a/src/m365/file/commands/file-list.ts +++ b/src/m365/file/commands/file-list.ts @@ -52,7 +52,7 @@ class FileListCommand extends GraphCommand { #initOptions(): void { this.options.unshift( { option: '-u, --webUrl ' }, - { option: '-f, --folderUrl ' }, + { option: '--folderUrl ' }, { option: '--recursive' } ); } diff --git a/src/m365/flow/commands/flow-export.ts b/src/m365/flow/commands/flow-export.ts index d1483030f08..921fa0d257e 100644 --- a/src/m365/flow/commands/flow-export.ts +++ b/src/m365/flow/commands/flow-export.ts @@ -74,7 +74,7 @@ class FlowExportCommand extends PowerPlatformCommand { option: '-s, --packageSourceEnvironment [packageSourceEnvironment]' }, { - option: '-f, --format [format]' + option: '--format [format]' }, { option: '-p, --path [path]' diff --git a/src/m365/flow/commands/flow-remove.spec.ts b/src/m365/flow/commands/flow-remove.spec.ts index ef7c9a1e634..2e656c29d22 100644 --- a/src/m365/flow/commands/flow-remove.spec.ts +++ b/src/m365/flow/commands/flow-remove.spec.ts @@ -211,7 +211,7 @@ describe(commands.REMOVE, () => { debug: true, environmentName: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', name: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72', - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -231,7 +231,7 @@ describe(commands.REMOVE, () => { debug: true, environmentName: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', name: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72', - confirm: true, + force: true, asAdmin: true } }); @@ -251,7 +251,7 @@ describe(commands.REMOVE, () => { { environmentName: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', name: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72', - confirm: true + force: true } } as any), new CommandError(`Access to the environment 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c' is denied.`)); }); @@ -299,7 +299,7 @@ describe(commands.REMOVE, () => { { environmentName: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', name: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72', - confirm: true + force: true } } as any), new CommandError(`Error: Resource '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72' does not exist in environment 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c'`)); }); diff --git a/src/m365/flow/commands/flow-remove.ts b/src/m365/flow/commands/flow-remove.ts index d2ffa30dfe0..43ec5592d10 100644 --- a/src/m365/flow/commands/flow-remove.ts +++ b/src/m365/flow/commands/flow-remove.ts @@ -15,7 +15,7 @@ interface Options extends GlobalOptions { environmentName: string; name: string; asAdmin?: boolean; - confirm?: boolean; + force?: boolean; } class FlowRemoveCommand extends AzmgmtCommand { @@ -39,7 +39,7 @@ class FlowRemoveCommand extends AzmgmtCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { asAdmin: !!args.options.asAdmin, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -56,7 +56,7 @@ class FlowRemoveCommand extends AzmgmtCommand { option: '--asAdmin' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -101,7 +101,7 @@ class FlowRemoveCommand extends AzmgmtCommand { this.handleRejectedODataJsonPromise(err); } }; - if (args.options.confirm) { + if (args.options.force) { await removeFlow(); } else { diff --git a/src/m365/flow/commands/owner/owner-ensure.ts b/src/m365/flow/commands/owner/owner-ensure.ts index 2fa5d6cdf84..3ea445681a3 100644 --- a/src/m365/flow/commands/owner/owner-ensure.ts +++ b/src/m365/flow/commands/owner/owner-ensure.ts @@ -62,7 +62,7 @@ class FlowOwnerEnsureCommand extends AzmgmtCommand { option: '-e, --environmentName ' }, { - option: '-f, --flowName ' + option: '--flowName ' }, { option: '--userId [userId]' diff --git a/src/m365/flow/commands/owner/owner-list.ts b/src/m365/flow/commands/owner/owner-list.ts index fb9b6ec10de..85755b66e96 100644 --- a/src/m365/flow/commands/owner/owner-list.ts +++ b/src/m365/flow/commands/owner/owner-list.ts @@ -70,7 +70,7 @@ class FlowOwnerListCommand extends AzmgmtCommand { option: '-e, --environmentName ' }, { - option: '-f, --flowName ' + option: '--flowName ' }, { option: '--asAdmin' diff --git a/src/m365/flow/commands/owner/owner-remove.spec.ts b/src/m365/flow/commands/owner/owner-remove.spec.ts index 248d6674268..40ef0d57419 100644 --- a/src/m365/flow/commands/owner/owner-remove.spec.ts +++ b/src/m365/flow/commands/owner/owner-remove.spec.ts @@ -93,7 +93,7 @@ describe(commands.OWNER_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environmentName: environmentName, flowName: flowName, userId: userId, confirm: true } }); + await command.action(logger, { options: { verbose: true, environmentName: environmentName, flowName: flowName, userId: userId, force: true } }); assert.deepStrictEqual(postStub.lastCall.args[0].data, requestBodyUser); }); @@ -107,7 +107,7 @@ describe(commands.OWNER_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environmentName: environmentName, flowName: flowName, userName: userName, confirm: true } }); + await command.action(logger, { options: { verbose: true, environmentName: environmentName, flowName: flowName, userName: userName, force: true } }); assert.deepStrictEqual(postStub.lastCall.args[0].data, requestBodyUser); }); @@ -136,7 +136,7 @@ describe(commands.OWNER_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, environmentName: environmentName, flowName: flowName, groupName: groupName, asAdmin: true, confirm: true } }); + await command.action(logger, { options: { verbose: true, environmentName: environmentName, flowName: flowName, groupName: groupName, asAdmin: true, force: true } }); assert.deepStrictEqual(postStub.lastCall.args[0].data, requestBodyGroup); }); @@ -149,7 +149,7 @@ describe(commands.OWNER_REMOVE, () => { }; sinon.stub(request, 'post').rejects(error); - await assert.rejects(command.action(logger, { options: { environmentName: environmentName, flowName: flowName, userId: userId, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { environmentName: environmentName, flowName: flowName, userId: userId, force: true } } as any), new CommandError(error.error.message)); }); diff --git a/src/m365/flow/commands/owner/owner-remove.ts b/src/m365/flow/commands/owner/owner-remove.ts index 29f448fb88d..6a93a18c8b5 100644 --- a/src/m365/flow/commands/owner/owner-remove.ts +++ b/src/m365/flow/commands/owner/owner-remove.ts @@ -21,7 +21,7 @@ interface Options extends GlobalOptions { groupId?: string; groupName?: string; asAdmin?: boolean; - confirm?: boolean; + force?: boolean; } class FlowOwnerRemoveCommand extends AzmgmtCommand { @@ -50,7 +50,7 @@ class FlowOwnerRemoveCommand extends AzmgmtCommand { groupId: typeof args.options.groupId !== 'undefined', groupName: typeof args.options.groupName !== 'undefined', asAdmin: !!args.options.asAdmin, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -61,7 +61,7 @@ class FlowOwnerRemoveCommand extends AzmgmtCommand { option: '-e, --environmentName ' }, { - option: '-f, --flowName ' + option: '--flowName ' }, { option: '--userId [userId]' @@ -79,7 +79,7 @@ class FlowOwnerRemoveCommand extends AzmgmtCommand { option: '--asAdmin' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -150,7 +150,7 @@ class FlowOwnerRemoveCommand extends AzmgmtCommand { await request.post(requestOptions); }; - if (args.options.confirm) { + if (args.options.force) { await removeFlowOwner(); } else { diff --git a/src/m365/flow/commands/run/run-cancel.spec.ts b/src/m365/flow/commands/run/run-cancel.spec.ts index f6abac68ef0..71260f0ff51 100644 --- a/src/m365/flow/commands/run/run-cancel.spec.ts +++ b/src/m365/flow/commands/run/run-cancel.spec.ts @@ -139,7 +139,7 @@ describe(commands.RUN_CANCEL, () => { environmentName: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', flowName: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72', name: '08585981115186985105550762687CU161', - confirm: true + force: true } }); assert(loggerLogSpy.called); @@ -182,7 +182,7 @@ describe(commands.RUN_CANCEL, () => { environmentName: 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c', flowName: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72', name: '08585981115186985105550762687CU161', - confirm: true + force: true } } as any), new CommandError(`You are not permitted to make flows in this 'Default-eff8592e-e14a-4ae8-8771-d96d5c549e1c'. Please switch to the default environment, or to one of your own environment(s), where you have maker permissions.`)); }); @@ -243,7 +243,7 @@ describe(commands.RUN_CANCEL, () => { environmentName: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6', flowName: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac88', name: '08585981115186985105550762687CU161', - confirm: true + force: true } } as any), new CommandError(`The caller with object id 'da8f7aea-cf43-497f-ad62-c2feae89a194' does not have permission for connection '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac88' under Api 'shared_logicflows'.`)); }); @@ -283,7 +283,7 @@ describe(commands.RUN_CANCEL, () => { environmentName: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6', flowName: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72', name: '08585981115186985105550762688CP233', - confirm: true + force: true } } as any), new CommandError(`Request to Azure Resource Manager failed with error: '{"error":{"code":"WorkflowRunNotFound","message":"The workflow '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72' run '08585981115186985105550762688CP233' could not be found."}}`)); }); diff --git a/src/m365/flow/commands/run/run-cancel.ts b/src/m365/flow/commands/run/run-cancel.ts index 86948e49baa..af69aa5c64c 100644 --- a/src/m365/flow/commands/run/run-cancel.ts +++ b/src/m365/flow/commands/run/run-cancel.ts @@ -37,7 +37,7 @@ class FlowRunCancelCommand extends AzmgmtCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -48,13 +48,13 @@ class FlowRunCancelCommand extends AzmgmtCommand { option: '-n, --name ' }, { - option: '-f, --flowName ' + option: '--flowName ' }, { option: '-e, --environmentName ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -93,7 +93,7 @@ class FlowRunCancelCommand extends AzmgmtCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await cancelFlow(); } else { diff --git a/src/m365/flow/commands/run/run-get.ts b/src/m365/flow/commands/run/run-get.ts index 0e5818d27f6..8d249c8c637 100644 --- a/src/m365/flow/commands/run/run-get.ts +++ b/src/m365/flow/commands/run/run-get.ts @@ -44,7 +44,7 @@ class FlowRunGetCommand extends AzmgmtCommand { option: '-n, --name ' }, { - option: '-f, --flowName ' + option: '--flowName ' }, { option: '-e, --environmentName ' diff --git a/src/m365/flow/commands/run/run-list.ts b/src/m365/flow/commands/run/run-list.ts index 23f924c928a..0090f2d15da 100644 --- a/src/m365/flow/commands/run/run-list.ts +++ b/src/m365/flow/commands/run/run-list.ts @@ -55,7 +55,7 @@ class FlowRunListCommand extends AzmgmtItemsListCommand<{ name: string, startTim #initOptions(): void { this.options.unshift( { - option: '-f, --flowName ' + option: '--flowName ' }, { option: '-e, --environmentName ' diff --git a/src/m365/flow/commands/run/run-resubmit.spec.ts b/src/m365/flow/commands/run/run-resubmit.spec.ts index f7bf54274dd..9eaf6ee442a 100644 --- a/src/m365/flow/commands/run/run-resubmit.spec.ts +++ b/src/m365/flow/commands/run/run-resubmit.spec.ts @@ -306,7 +306,7 @@ describe(commands.RUN_RESUBMIT, () => { environmentName: 'Default-d87a7535-dd31-4437-bfe1-95340acd55c6', flowName: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac88', name: '08585981115186985105550762687CU161', - confirm: true + force: true } }); assert.strictEqual(getStub.lastCall.args[0].url, 'https://management.azure.com/providers/Microsoft.ProcessSimple/environments/Default-d87a7535-dd31-4437-bfe1-95340acd55c6/flows/0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac88/triggers?api-version=2016-11-01'); diff --git a/src/m365/flow/commands/run/run-resubmit.ts b/src/m365/flow/commands/run/run-resubmit.ts index a85057df04c..6ed8f489800 100644 --- a/src/m365/flow/commands/run/run-resubmit.ts +++ b/src/m365/flow/commands/run/run-resubmit.ts @@ -13,7 +13,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm: boolean; + force: boolean; environmentName: string; flowName: string; name: string; @@ -39,7 +39,7 @@ class FlowRunResubmitCommand extends AzmgmtCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: args.options.confirm + force: args.options.force }); }); } @@ -50,13 +50,13 @@ class FlowRunResubmitCommand extends AzmgmtCommand { option: '-n, --name ' }, { - option: '-f, --flowName ' + option: '--flowName ' }, { option: '-e, --environmentName ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -101,7 +101,7 @@ class FlowRunResubmitCommand extends AzmgmtCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await resubmitFlow(); } else { diff --git a/src/m365/graph/commands/schemaextension/schemaextension-remove.spec.ts b/src/m365/graph/commands/schemaextension/schemaextension-remove.spec.ts index 7b01f3890d6..e29aefa8473 100644 --- a/src/m365/graph/commands/schemaextension/schemaextension-remove.spec.ts +++ b/src/m365/graph/commands/schemaextension/schemaextension-remove.spec.ts @@ -78,7 +78,7 @@ describe(commands.SCHEMAEXTENSION_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: 'exttyee4dv5_MySchemaExtension', confirm: true } }); + await command.action(logger, { options: { id: 'exttyee4dv5_MySchemaExtension', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -91,7 +91,7 @@ describe(commands.SCHEMAEXTENSION_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, id: 'exttyee4dv5_MySchemaExtension', confirm: true } }); + await command.action(logger, { options: { debug: true, id: 'exttyee4dv5_MySchemaExtension', force: true } }); assert(loggerLogToStderrSpy.called); }); @@ -133,14 +133,14 @@ describe(commands.SCHEMAEXTENSION_REMOVE, () => { it('correctly handles random API error', async () => { sinon.stub(request, 'delete').rejects({ error: 'An error has occurred' }); - await assert.rejects(command.action(logger, { options: { id: 'exttyee4dv5_MySchemaExtension', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'exttyee4dv5_MySchemaExtension', force: true } } as any), new CommandError('An error has occurred')); }); it('correctly handles random API error (string error)', async () => { sinon.stub(request, 'delete').rejects(new Error('An error has occurred')); - await assert.rejects(command.action(logger, { options: { id: 'exttyee4dv5_MySchemaExtension', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'exttyee4dv5_MySchemaExtension', force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/graph/commands/schemaextension/schemaextension-remove.ts b/src/m365/graph/commands/schemaextension/schemaextension-remove.ts index a65f7364c6e..9dabc878a7a 100644 --- a/src/m365/graph/commands/schemaextension/schemaextension-remove.ts +++ b/src/m365/graph/commands/schemaextension/schemaextension-remove.ts @@ -11,7 +11,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class GraphSchemaExtensionRemoveCommand extends GraphCommand { @@ -33,7 +33,7 @@ class GraphSchemaExtensionRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: typeof args.options.confirm !== 'undefined' + force: typeof args.options.force !== 'undefined' }); }); } @@ -44,7 +44,7 @@ class GraphSchemaExtensionRemoveCommand extends GraphCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -72,7 +72,7 @@ class GraphSchemaExtensionRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeSchemaExtension(); } else { diff --git a/src/m365/outlook/commands/room/room-list.spec.ts b/src/m365/outlook/commands/room/room-list.spec.ts index 177b0266c7b..9735ae0f202 100644 --- a/src/m365/outlook/commands/room/room-list.spec.ts +++ b/src/m365/outlook/commands/room/room-list.spec.ts @@ -201,6 +201,6 @@ describe(commands.ROOM_LIST, () => { const errorMessage = 'Something went wrong'; sinon.stub(request, 'get').rejects({ error: { error: { message: errorMessage } } }); - await assert.rejects(command.action(logger, { options: { confirm: true } }), new CommandError(errorMessage)); + await assert.rejects(command.action(logger, { options: { force: true } }), new CommandError(errorMessage)); }); }); diff --git a/src/m365/outlook/commands/roomlist/roomlist-list.spec.ts b/src/m365/outlook/commands/roomlist/roomlist-list.spec.ts index 8fd83739aeb..6aac79e5594 100644 --- a/src/m365/outlook/commands/roomlist/roomlist-list.spec.ts +++ b/src/m365/outlook/commands/roomlist/roomlist-list.spec.ts @@ -116,6 +116,6 @@ describe(commands.ROOMLIST_LIST, () => { const errorMessage = 'Something went wrong'; sinon.stub(request, 'get').rejects({ error: { error: { message: errorMessage } } }); - await assert.rejects(command.action(logger, { options: { confirm: true } }), new CommandError(errorMessage)); + await assert.rejects(command.action(logger, { options: { force: true } }), new CommandError(errorMessage)); }); }); 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 00809066662..80f6fcc8bbc 100644 --- a/src/m365/pa/commands/app/app-consent-set.spec.ts +++ b/src/m365/pa/commands/app/app-consent-set.spec.ts @@ -163,7 +163,7 @@ describe(commands.APP_CONSENT_SET, () => { environment: environment, name: name, bypass: true, - confirm: true + force: true } })); }); @@ -182,7 +182,7 @@ describe(commands.APP_CONSENT_SET, () => { environment: environment, name: name, bypass: true, - confirm: true + force: true } } as any), new CommandError(error.error.message)); }); diff --git a/src/m365/pa/commands/app/app-consent-set.ts b/src/m365/pa/commands/app/app-consent-set.ts index 246932ee49a..7cb610931eb 100644 --- a/src/m365/pa/commands/app/app-consent-set.ts +++ b/src/m365/pa/commands/app/app-consent-set.ts @@ -14,7 +14,7 @@ interface Options extends GlobalOptions { environment: string, name: string; bypass: boolean; - confirm?: boolean; + force?: boolean; } class PaAppConsentSetCommand extends PowerAppsCommand { @@ -47,7 +47,7 @@ class PaAppConsentSetCommand extends PowerAppsCommand { autocomplete: ['true', 'false'] }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -73,7 +73,7 @@ class PaAppConsentSetCommand extends PowerAppsCommand { logger.logToStderr(`Setting the bypass consent for the Microsoft Power App ${args.options.name}... to ${args.options.bypass}`); } - if (args.options.confirm) { + if (args.options.force) { await this.consentPaApp(args); } else { diff --git a/src/m365/pa/commands/app/app-remove.spec.ts b/src/m365/pa/commands/app/app-remove.spec.ts index a343216d449..b075dfd8932 100644 --- a/src/m365/pa/commands/app/app-remove.spec.ts +++ b/src/m365/pa/commands/app/app-remove.spec.ts @@ -171,7 +171,7 @@ describe(commands.APP_REMOVE, () => { options: { debug: true, name: 'e0c89645-7f00-4877-a290-cbaf6e060da1', - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -190,7 +190,7 @@ describe(commands.APP_REMOVE, () => { options: { debug: true, name: '0f64d9dd-01bb-4c1b-95b3-cb4a1a08ac72', - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -217,7 +217,7 @@ describe(commands.APP_REMOVE, () => { options: { name: 'e0c89645-7f00-4877-a290-cbaf6e060da1', - confirm: true + force: true } } as any), new CommandError(`App 'e0c89645-7f00-4877-a290-cbaf6e060da1' does not exist`)); }); @@ -243,7 +243,7 @@ describe(commands.APP_REMOVE, () => { options: { name: 'e0c89645-7f00-4877-a290-cbaf6e060da1', - confirm: true + force: true } } as any); }); @@ -263,7 +263,7 @@ describe(commands.APP_REMOVE, () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/pa/commands/app/app-remove.ts b/src/m365/pa/commands/app/app-remove.ts index a888dc579e9..26c1b07b185 100644 --- a/src/m365/pa/commands/app/app-remove.ts +++ b/src/m365/pa/commands/app/app-remove.ts @@ -14,7 +14,7 @@ interface CommandArgs { interface Options extends GlobalOptions { name: string; - confirm?: boolean; + force?: boolean; } class PaAppRemoveCommand extends PowerAppsCommand { @@ -37,7 +37,7 @@ class PaAppRemoveCommand extends PowerAppsCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: typeof args.options.confirm !== 'undefined' + force: typeof args.options.force !== 'undefined' }); }); } @@ -48,7 +48,7 @@ class PaAppRemoveCommand extends PowerAppsCommand { option: '-n, --name ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -93,7 +93,7 @@ class PaAppRemoveCommand extends PowerAppsCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removePaApp(); } else { diff --git a/src/m365/planner/commands/bucket/bucket-remove.spec.ts b/src/m365/planner/commands/bucket/bucket-remove.spec.ts index f0b77d2674a..f280287ebb8 100644 --- a/src/m365/planner/commands/bucket/bucket-remove.spec.ts +++ b/src/m365/planner/commands/bucket/bucket-remove.spec.ts @@ -278,7 +278,7 @@ describe(commands.BUCKET_REMOVE, () => { name: validBucketName, planTitle: validPlanTitle, ownerGroupName: validOwnerGroupName, - confirm: true + force: true } }), new CommandError(`The specified group '${validOwnerGroupName}' does not exist.`)); }); @@ -297,7 +297,7 @@ describe(commands.BUCKET_REMOVE, () => { name: validBucketName, planTitle: validPlanTitle, ownerGroupName: validOwnerGroupName, - confirm: true + force: true } }), new CommandError(`Multiple groups with name '${validOwnerGroupName}' found: ${multipleGroupResponse.value.map(x => x.id)}.`)); }); @@ -315,7 +315,7 @@ describe(commands.BUCKET_REMOVE, () => { options: { name: validBucketName, planId: validPlanId, - confirm: true + force: true } }), new CommandError(`The specified bucket ${validBucketName} does not exist`)); }); @@ -333,7 +333,7 @@ describe(commands.BUCKET_REMOVE, () => { options: { name: validBucketName, planId: validPlanId, - confirm: true + force: true } }), new CommandError(`Multiple buckets with name ${validBucketName} found: ${multipleBucketByNameResponse.value.map(x => x.id)}`)); }); @@ -357,7 +357,7 @@ describe(commands.BUCKET_REMOVE, () => { await assert.doesNotReject(command.action(logger, { options: { id: validBucketId, - confirm: true + force: true } })); }); @@ -389,7 +389,7 @@ describe(commands.BUCKET_REMOVE, () => { name: validBucketName, planTitle: validPlanTitle, ownerGroupName: validOwnerGroupName, - confirm: true + force: true } })); }); diff --git a/src/m365/planner/commands/bucket/bucket-remove.ts b/src/m365/planner/commands/bucket/bucket-remove.ts index 84b338b9e82..5fcf0b8c8e7 100644 --- a/src/m365/planner/commands/bucket/bucket-remove.ts +++ b/src/m365/planner/commands/bucket/bucket-remove.ts @@ -21,7 +21,7 @@ interface Options extends GlobalOptions { rosterId?: string; ownerGroupId?: string; ownerGroupName?: string; - confirm?: boolean; + force?: boolean; } class PlannerBucketRemoveCommand extends GraphCommand { @@ -52,7 +52,7 @@ class PlannerBucketRemoveCommand extends GraphCommand { rosterId: typeof args.options.rosterId !== 'undefined', ownerGroupId: typeof args.options.ownerGroupId !== 'undefined', ownerGroupName: typeof args.options.ownerGroupName !== 'undefined', - confirm: args.options.confirm || false + force: args.options.force || false }); }); } @@ -81,7 +81,7 @@ class PlannerBucketRemoveCommand extends GraphCommand { option: '--ownerGroupName [ownerGroupName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -152,7 +152,7 @@ class PlannerBucketRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeBucket(); } else { diff --git a/src/m365/planner/commands/plan/plan-remove.spec.ts b/src/m365/planner/commands/plan/plan-remove.spec.ts index ae11d3c4baf..4283c70a02c 100644 --- a/src/m365/planner/commands/plan/plan-remove.spec.ts +++ b/src/m365/planner/commands/plan/plan-remove.spec.ts @@ -211,7 +211,7 @@ describe(commands.PLAN_REMOVE, () => { await command.action(logger, { options: { id: validPlanId, - confirm: true + force: true } }); }); @@ -280,7 +280,7 @@ describe(commands.PLAN_REMOVE, () => { await assert.rejects(command.action(logger, { options: { id: validPlanId, - confirm: true + force: true } }), new CommandError("An error has occurred")); }); diff --git a/src/m365/planner/commands/plan/plan-remove.ts b/src/m365/planner/commands/plan/plan-remove.ts index 208194da466..ab222d52092 100644 --- a/src/m365/planner/commands/plan/plan-remove.ts +++ b/src/m365/planner/commands/plan/plan-remove.ts @@ -18,7 +18,7 @@ interface Options extends GlobalOptions { title?: string; ownerGroupId?: string; ownerGroupName?: string; - confirm?: boolean; + force?: boolean; } class PlannerPlanRemoveCommand extends GraphCommand { @@ -46,7 +46,7 @@ class PlannerPlanRemoveCommand extends GraphCommand { title: typeof args.options.title !== 'undefined', ownerGroupId: typeof args.options.ownerGroupId !== 'undefined', ownerGroupName: typeof args.options.ownerGroupName !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -66,7 +66,7 @@ class PlannerPlanRemoveCommand extends GraphCommand { option: '--ownerGroupName [ownerGroupName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -121,7 +121,7 @@ class PlannerPlanRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removePlan(); } else { diff --git a/src/m365/planner/commands/roster/roster-member-remove.spec.ts b/src/m365/planner/commands/roster/roster-member-remove.spec.ts index 1789d9b02f8..4ee8208044d 100644 --- a/src/m365/planner/commands/roster/roster-member-remove.spec.ts +++ b/src/m365/planner/commands/roster/roster-member-remove.spec.ts @@ -275,7 +275,7 @@ describe(commands.ROSTER_MEMBER_REMOVE, () => { verbose: true, rosterId: validRosterId, userId: validUserId, - confirm: true + force: true } }); @@ -294,7 +294,7 @@ describe(commands.ROSTER_MEMBER_REMOVE, () => { options: { rosterId: validRosterId, userId: validUserId, - confirm: true + force: true } }), new CommandError('The roster member cannot be found.')); }); diff --git a/src/m365/planner/commands/roster/roster-member-remove.ts b/src/m365/planner/commands/roster/roster-member-remove.ts index f700b65a269..c12510ce440 100644 --- a/src/m365/planner/commands/roster/roster-member-remove.ts +++ b/src/m365/planner/commands/roster/roster-member-remove.ts @@ -16,7 +16,7 @@ export interface Options extends GlobalOptions { rosterId: string; userId?: string; userName?: string; - confirm?: boolean; + force?: boolean; } class PlannerRosterMemberRemoveCommand extends GraphCommand { @@ -42,7 +42,7 @@ class PlannerRosterMemberRemoveCommand extends GraphCommand { Object.assign(this.telemetryProperties, { userId: typeof args.options.userId !== 'undefined', userName: typeof args.options.userName !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -59,7 +59,7 @@ class PlannerRosterMemberRemoveCommand extends GraphCommand { option: '--userName [userName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -91,7 +91,7 @@ class PlannerRosterMemberRemoveCommand extends GraphCommand { logger.logToStderr(`Removing member ${args.options.userName || args.options.userId} from the Microsoft Planner Roster`); } - if (args.options.confirm) { + if (args.options.force) { await this.removeRosterMember(args); } else { @@ -139,7 +139,7 @@ class PlannerRosterMemberRemoveCommand extends GraphCommand { } private async removeLastMemberConfirmation(args: CommandArgs): Promise { - if (!args.options.confirm) { + if (!args.options.force) { const rosterMembers = await odata.getAllItems(`${this.resource}/beta/planner/rosters/${args.options.rosterId}/members?$select=Id`); if (rosterMembers.length === 1) { const result = await Cli.prompt<{ continue: boolean }>({ diff --git a/src/m365/planner/commands/roster/roster-remove.spec.ts b/src/m365/planner/commands/roster/roster-remove.spec.ts index 8ed8f452212..0b961c7e265 100644 --- a/src/m365/planner/commands/roster/roster-remove.spec.ts +++ b/src/m365/planner/commands/roster/roster-remove.spec.ts @@ -111,7 +111,7 @@ describe(commands.PLAN_REMOVE, () => { options: { verbose: true, id: validRosterId, - confirm: true + force: true } }); }); @@ -145,7 +145,7 @@ describe(commands.PLAN_REMOVE, () => { await assert.rejects(command.action(logger, { options: { id: validRosterId, - confirm: true + force: true } }), new CommandError('The requested item is not found.')); }); diff --git a/src/m365/planner/commands/roster/roster-remove.ts b/src/m365/planner/commands/roster/roster-remove.ts index c41a0d1f5d4..62cabf83f84 100644 --- a/src/m365/planner/commands/roster/roster-remove.ts +++ b/src/m365/planner/commands/roster/roster-remove.ts @@ -11,7 +11,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class PlannerRosterRemoveCommand extends GraphCommand { @@ -33,7 +33,7 @@ class PlannerRosterRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -44,13 +44,13 @@ class PlannerRosterRemoveCommand extends GraphCommand { option: '--id ' }, { - option: '--confirm' + option: '-f, --force' } ); } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeRoster(args, logger); } else { diff --git a/src/m365/planner/commands/task/task-checklistitem-remove.spec.ts b/src/m365/planner/commands/task/task-checklistitem-remove.spec.ts index 2aba980bdfe..e3866c759b0 100644 --- a/src/m365/planner/commands/task/task-checklistitem-remove.spec.ts +++ b/src/m365/planner/commands/task/task-checklistitem-remove.spec.ts @@ -147,7 +147,7 @@ describe(commands.TASK_CHECKLISTITEM_REMOVE, () => { options: { taskId: validTaskId, id: validId, - confirm: true + force: true } }); }); diff --git a/src/m365/planner/commands/task/task-checklistitem-remove.ts b/src/m365/planner/commands/task/task-checklistitem-remove.ts index 883f1759355..721415897c2 100644 --- a/src/m365/planner/commands/task/task-checklistitem-remove.ts +++ b/src/m365/planner/commands/task/task-checklistitem-remove.ts @@ -14,7 +14,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; taskId: string; - confirm?: boolean; + force?: boolean; } class PlannerTaskChecklistItemRemoveCommand extends GraphCommand { @@ -36,7 +36,7 @@ class PlannerTaskChecklistItemRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -45,12 +45,12 @@ class PlannerTaskChecklistItemRemoveCommand extends GraphCommand { this.options.unshift( { option: '-i, --id ' }, { option: '--taskId ' }, - { option: '--confirm' } + { option: '-f, --force' } ); } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeChecklistitem(args); } else { diff --git a/src/m365/planner/commands/task/task-reference-remove.spec.ts b/src/m365/planner/commands/task/task-reference-remove.spec.ts index 7dc8969e185..08349d71778 100644 --- a/src/m365/planner/commands/task/task-reference-remove.spec.ts +++ b/src/m365/planner/commands/task/task-reference-remove.spec.ts @@ -194,7 +194,7 @@ describe(commands.TASK_REFERENCE_REMOVE, () => { const options: any = { taskId: validTaskId, url: validUrl, - confirm: true + force: true }; await command.action(logger, { options: options } as any); diff --git a/src/m365/planner/commands/task/task-reference-remove.ts b/src/m365/planner/commands/task/task-reference-remove.ts index d0ab0735725..36a7d7672a3 100644 --- a/src/m365/planner/commands/task/task-reference-remove.ts +++ b/src/m365/planner/commands/task/task-reference-remove.ts @@ -15,7 +15,7 @@ interface Options extends GlobalOptions { url?: string; alias?: string; taskId: string; - confirm?: boolean; + force?: boolean; } class PlannerTaskReferenceRemoveCommand extends GraphCommand { @@ -41,7 +41,7 @@ class PlannerTaskReferenceRemoveCommand extends GraphCommand { Object.assign(this.telemetryProperties, { url: typeof args.options.url !== 'undefined', alias: typeof args.options.alias !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -51,7 +51,7 @@ class PlannerTaskReferenceRemoveCommand extends GraphCommand { { option: '-u, --url [url]' }, { option: '--alias [alias]' }, { option: '-i, --taskId ' }, - { option: '--confirm' } + { option: '-f, --force' } ); } @@ -74,7 +74,7 @@ class PlannerTaskReferenceRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeReference(logger, args); } else { diff --git a/src/m365/planner/commands/task/task-remove.spec.ts b/src/m365/planner/commands/task/task-remove.spec.ts index 4d6463d8f23..795bf80cb9f 100644 --- a/src/m365/planner/commands/task/task-remove.spec.ts +++ b/src/m365/planner/commands/task/task-remove.spec.ts @@ -307,7 +307,7 @@ describe(commands.TASK_REMOVE, () => { bucketName: validBucketName, planTitle: validPlanTitle, ownerGroupName: validOwnerGroupName, - confirm: true + force: true } }), new CommandError(`The specified group '${validOwnerGroupName}' does not exist.`)); }); @@ -327,7 +327,7 @@ describe(commands.TASK_REMOVE, () => { bucketName: validBucketName, planTitle: validPlanTitle, ownerGroupName: validOwnerGroupName, - confirm: true + force: true } }), new CommandError(`Multiple groups with name '${validOwnerGroupName}' found: ${multipleGroupResponse.value.map(x => x.id)}.`)); }); @@ -346,7 +346,7 @@ describe(commands.TASK_REMOVE, () => { title: validTaskTitle, bucketName: validBucketName, planId: validPlanId, - confirm: true + force: true } }), new CommandError(`The specified bucket ${validBucketName} does not exist`)); }); @@ -365,7 +365,7 @@ describe(commands.TASK_REMOVE, () => { title: validTaskTitle, bucketName: validBucketName, planId: validPlanId, - confirm: true + force: true } }), new CommandError(`Multiple buckets with name ${validBucketName} found: Please disambiguate:${os.EOL}${multipleBucketByNameResponse.value.map(f => `- ${f.id}`).join(os.EOL)}`)); }); @@ -383,7 +383,7 @@ describe(commands.TASK_REMOVE, () => { options: { title: validTaskTitle, bucketId: validBucketId, - confirm: true + force: true } }), new CommandError(`The specified task ${validTaskTitle} does not exist`)); }); @@ -401,7 +401,7 @@ describe(commands.TASK_REMOVE, () => { options: { title: validTaskTitle, bucketId: validBucketId, - confirm: true + force: true } }), new CommandError(`Multiple tasks with title ${validTaskTitle} found: Please disambiguate: ${os.EOL}${multipleTasksByTitleResponse.value.map(f => `- ${f.id}`).join(os.EOL)}`)); }); @@ -454,7 +454,7 @@ describe(commands.TASK_REMOVE, () => { await command.action(logger, { options: { id: validTaskId, - confirm: true + force: true } }); }); diff --git a/src/m365/planner/commands/task/task-remove.ts b/src/m365/planner/commands/task/task-remove.ts index d396588904c..d61bbe68bea 100644 --- a/src/m365/planner/commands/task/task-remove.ts +++ b/src/m365/planner/commands/task/task-remove.ts @@ -24,7 +24,7 @@ interface Options extends GlobalOptions { planTitle?: string; ownerGroupId?: string; ownerGroupName?: string; - confirm?: boolean; + force?: boolean; } class PlannerTaskRemoveCommand extends GraphCommand { @@ -56,7 +56,7 @@ class PlannerTaskRemoveCommand extends GraphCommand { planTitle: typeof args.options.planTitle !== 'undefined', ownerGroupId: typeof args.options.ownerGroupId !== 'undefined', ownerGroupName: typeof args.options.ownerGroupName !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -71,7 +71,7 @@ class PlannerTaskRemoveCommand extends GraphCommand { { option: '--planTitle [planTitle]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' }, - { option: '--confirm' } + { option: '-f, --force' } ); } @@ -148,7 +148,7 @@ class PlannerTaskRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeTask(); } else { diff --git a/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.spec.ts b/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.spec.ts index be8e6affc99..b1ea44ac6b9 100644 --- a/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.spec.ts +++ b/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.spec.ts @@ -223,7 +223,7 @@ describe(commands.AIBUILDERMODEL_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -241,7 +241,7 @@ describe(commands.AIBUILDERMODEL_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.ts b/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.ts index 3c0d9c30e24..83c459ef102 100644 --- a/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.ts +++ b/src/m365/pp/commands/aibuildermodel/aibuildermodel-remove.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { id?: string; name?: string; asAdmin?: boolean; - confirm?: boolean; + force?: boolean; } class PpAiBuilderModelRemoveCommand extends PowerPlatformCommand { @@ -47,7 +47,7 @@ class PpAiBuilderModelRemoveCommand extends PowerPlatformCommand { id: typeof args.options.id !== 'undefined', name: typeof args.options.name !== 'undefined', asAdmin: !!args.options.asAdmin, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -67,7 +67,7 @@ class PpAiBuilderModelRemoveCommand extends PowerPlatformCommand { option: '--asAdmin' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -95,7 +95,7 @@ class PpAiBuilderModelRemoveCommand extends PowerPlatformCommand { logger.logToStderr(`Removing AI builder model '${args.options.id || args.options.name}'...`); } - if (args.options.confirm) { + if (args.options.force) { await this.deleteAiBuilderModel(args); } else { diff --git a/src/m365/pp/commands/card/card-clone.spec.ts b/src/m365/pp/commands/card/card-clone.spec.ts index dad65fe3c86..fe54243e4ff 100644 --- a/src/m365/pp/commands/card/card-clone.spec.ts +++ b/src/m365/pp/commands/card/card-clone.spec.ts @@ -170,7 +170,7 @@ describe(commands.CARD_CLONE, () => { debug: true, environment: validEnvironment, name: validName, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/pp/commands/card/card-remove.spec.ts b/src/m365/pp/commands/card/card-remove.spec.ts index f9cdfa6b06c..860f52e30cb 100644 --- a/src/m365/pp/commands/card/card-remove.spec.ts +++ b/src/m365/pp/commands/card/card-remove.spec.ts @@ -185,7 +185,7 @@ describe(commands.CARD_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -203,7 +203,7 @@ describe(commands.CARD_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/pp/commands/card/card-remove.ts b/src/m365/pp/commands/card/card-remove.ts index bab4b30cb77..d3e20ed1bb4 100644 --- a/src/m365/pp/commands/card/card-remove.ts +++ b/src/m365/pp/commands/card/card-remove.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { id?: string; name?: string; asAdmin?: boolean; - confirm?: boolean; + force?: boolean; } class PpCardRemoveCommand extends PowerPlatformCommand { @@ -47,7 +47,7 @@ class PpCardRemoveCommand extends PowerPlatformCommand { id: typeof args.options.id !== 'undefined', name: typeof args.options.name !== 'undefined', asAdmin: !!args.options.asAdmin, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -67,7 +67,7 @@ class PpCardRemoveCommand extends PowerPlatformCommand { option: '--asAdmin' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -95,7 +95,7 @@ class PpCardRemoveCommand extends PowerPlatformCommand { logger.logToStderr(`Removing card '${args.options.id || args.options.name}'...`); } - if (args.options.confirm) { + if (args.options.force) { await this.deleteCard(args); } else { diff --git a/src/m365/pp/commands/chatbot/chatbot-remove.spec.ts b/src/m365/pp/commands/chatbot/chatbot-remove.spec.ts index 8ec585cb4e7..a0355a0416c 100644 --- a/src/m365/pp/commands/chatbot/chatbot-remove.spec.ts +++ b/src/m365/pp/commands/chatbot/chatbot-remove.spec.ts @@ -180,7 +180,7 @@ describe(commands.CHATBOT_REMOVE, () => { verbose: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -198,7 +198,7 @@ describe(commands.CHATBOT_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/pp/commands/chatbot/chatbot-remove.ts b/src/m365/pp/commands/chatbot/chatbot-remove.ts index 2acfec92b86..1c1c02fff69 100644 --- a/src/m365/pp/commands/chatbot/chatbot-remove.ts +++ b/src/m365/pp/commands/chatbot/chatbot-remove.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { id?: string; name?: string; asAdmin?: boolean; - confirm?: boolean; + force?: boolean; } class PpChatbotRemoveCommand extends PowerPlatformCommand { @@ -47,7 +47,7 @@ class PpChatbotRemoveCommand extends PowerPlatformCommand { id: typeof args.options.id !== 'undefined', name: typeof args.options.name !== 'undefined', asAdmin: !!args.options.asAdmin, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -67,7 +67,7 @@ class PpChatbotRemoveCommand extends PowerPlatformCommand { option: '--asAdmin' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -95,7 +95,7 @@ class PpChatbotRemoveCommand extends PowerPlatformCommand { logger.logToStderr(`Removing chatbot '${args.options.id || args.options.name}'...`); } - if (args.options.confirm) { + if (args.options.force) { await this.deleteChatbot(args); } else { 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 719d76d3e22..b2a112a1f32 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-remove.spec.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-remove.spec.ts @@ -144,7 +144,7 @@ describe(commands.DATAVERSE_TABLE_REMOVE, () => { debug: true, environment: validEnvironment, name: validName, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -170,7 +170,7 @@ describe(commands.DATAVERSE_TABLE_REMOVE, () => { } }); - await assert.rejects(command.action(logger, { options: { environment: validEnvironment, name: validName, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { environment: 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 ac103fb733e..20ff6d0b4f4 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-remove.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { environment: string; name: string; - confirm?: true; + force?: true; asAdmin?: boolean; } @@ -37,7 +37,7 @@ class PpDataverseTableRemoveCommand extends PowerPlatformCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { asAdmin: !!args.options.asAdmin, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -54,7 +54,7 @@ class PpDataverseTableRemoveCommand extends PowerPlatformCommand { option: '--asAdmin' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -64,7 +64,7 @@ class PpDataverseTableRemoveCommand extends PowerPlatformCommand { logger.logToStderr(`Removing a table for which the user is an admin...`); } - if (args.options.confirm) { + if (args.options.force) { await this.removeDataverseTable(args.options); } else { 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 cdf7d1d7d48..626abbc69cb 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 @@ -192,7 +192,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { environment: validEnvironment, id: validId, tableName: validTableName, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -210,7 +210,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true, + force: true, entitySetName: validEntitySetName } }), new CommandError(errorMessage)); @@ -233,7 +233,7 @@ describe(commands.DATAVERSE_TABLE_ROW_REMOVE, () => { environment: validEnvironment, id: validId, entitySetName: validEntitySetName, - confirm: true + 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 91279aa46a6..c8d72307b84 100644 --- a/src/m365/pp/commands/dataverse/dataverse-table-row-remove.ts +++ b/src/m365/pp/commands/dataverse/dataverse-table-row-remove.ts @@ -17,7 +17,7 @@ interface Options extends GlobalOptions { entitySetName?: string; tableName?: string; asAdmin?: boolean; - confirm?: boolean; + force?: boolean; } class PpDataverseTableRowRemoveCommand extends PowerPlatformCommand { @@ -45,7 +45,7 @@ class PpDataverseTableRowRemoveCommand extends PowerPlatformCommand { entitySetName: typeof args.options.entitySetName !== 'undefined', tableName: typeof args.options.tableName !== 'undefined', asAdmin: !!args.options.asAdmin, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -68,7 +68,7 @@ class PpDataverseTableRowRemoveCommand extends PowerPlatformCommand { option: '--asAdmin' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -96,7 +96,7 @@ class PpDataverseTableRowRemoveCommand extends PowerPlatformCommand { logger.logToStderr(`Removing row '${args.options.id}' from table '${args.options.tableName || args.options.entitySetName}'...`); } - if (args.options.confirm) { + if (args.options.force) { await this.deleteTableRow(logger, args); } else { 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 d89a817f8a3..6b4a7cfe3bd 100644 --- a/src/m365/pp/commands/solution/solution-publisher-remove.spec.ts +++ b/src/m365/pp/commands/solution/solution-publisher-remove.spec.ts @@ -181,7 +181,7 @@ describe(commands.SOLUTION_PUBLISHER_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -199,7 +199,7 @@ describe(commands.SOLUTION_PUBLISHER_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/pp/commands/solution/solution-publisher-remove.ts b/src/m365/pp/commands/solution/solution-publisher-remove.ts index d0a4988a275..76c0c30492c 100644 --- a/src/m365/pp/commands/solution/solution-publisher-remove.ts +++ b/src/m365/pp/commands/solution/solution-publisher-remove.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { id?: string; name?: string; asAdmin?: boolean; - confirm?: boolean; + force?: boolean; } class PpSolutionPublisherRemoveCommand extends PowerPlatformCommand { @@ -47,7 +47,7 @@ class PpSolutionPublisherRemoveCommand extends PowerPlatformCommand { id: typeof args.options.id !== 'undefined', name: typeof args.options.name !== 'undefined', asAdmin: !!args.options.asAdmin, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -67,7 +67,7 @@ class PpSolutionPublisherRemoveCommand extends PowerPlatformCommand { option: '--asAdmin' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -95,7 +95,7 @@ class PpSolutionPublisherRemoveCommand extends PowerPlatformCommand { logger.logToStderr(`Removes a publisher '${args.options.id || args.options.name}'...`); } - if (args.options.confirm) { + if (args.options.force) { await this.deletePublisher(args); } else { diff --git a/src/m365/pp/commands/solution/solution-remove.spec.ts b/src/m365/pp/commands/solution/solution-remove.spec.ts index d68182ff2d2..e91cda4b38e 100644 --- a/src/m365/pp/commands/solution/solution-remove.spec.ts +++ b/src/m365/pp/commands/solution/solution-remove.spec.ts @@ -192,7 +192,7 @@ describe(commands.SOLUTION_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -210,7 +210,7 @@ describe(commands.SOLUTION_REMOVE, () => { debug: true, environment: validEnvironment, id: validId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/pp/commands/solution/solution-remove.ts b/src/m365/pp/commands/solution/solution-remove.ts index 3d165d24a2d..3cf6f7273a9 100644 --- a/src/m365/pp/commands/solution/solution-remove.ts +++ b/src/m365/pp/commands/solution/solution-remove.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { id?: string; name?: string; asAdmin?: boolean; - confirm?: boolean; + force?: boolean; } class PpSolutionRemoveCommand extends PowerPlatformCommand { @@ -47,7 +47,7 @@ class PpSolutionRemoveCommand extends PowerPlatformCommand { id: typeof args.options.id !== 'undefined', name: typeof args.options.name !== 'undefined', asAdmin: !!args.options.asAdmin, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -67,7 +67,7 @@ class PpSolutionRemoveCommand extends PowerPlatformCommand { option: '--asAdmin' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -95,7 +95,7 @@ class PpSolutionRemoveCommand extends PowerPlatformCommand { logger.logToStderr(`Removing solution '${args.options.id || args.options.name}'...`); } - if (args.options.confirm) { + if (args.options.force) { await this.deleteSolution(args); } else { diff --git a/src/m365/purview/commands/retentionevent/retentionevent-remove.spec.ts b/src/m365/purview/commands/retentionevent/retentionevent-remove.spec.ts index 636ee64a3c0..20313fd7d4f 100644 --- a/src/m365/purview/commands/retentionevent/retentionevent-remove.spec.ts +++ b/src/m365/purview/commands/retentionevent/retentionevent-remove.spec.ts @@ -150,7 +150,7 @@ describe(commands.RETENTIONEVENT_REMOVE, () => { await command.action(logger, { options: { id: validId, - confirm: true + force: true } }); }); @@ -168,7 +168,7 @@ describe(commands.RETENTIONEVENT_REMOVE, () => { await assert.rejects(command.action(logger, { options: { id: validId, - confirm: true + force: true } }), new CommandError(error.error.message)); }); diff --git a/src/m365/purview/commands/retentionevent/retentionevent-remove.ts b/src/m365/purview/commands/retentionevent/retentionevent-remove.ts index 95e43ceb589..38e13e7e8e3 100644 --- a/src/m365/purview/commands/retentionevent/retentionevent-remove.ts +++ b/src/m365/purview/commands/retentionevent/retentionevent-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class PurviewRetentionEventRemoveCommand extends GraphCommand { @@ -35,7 +35,7 @@ class PurviewRetentionEventRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -46,7 +46,7 @@ class PurviewRetentionEventRemoveCommand extends GraphCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -64,7 +64,7 @@ class PurviewRetentionEventRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeRetentionEvent(args.options); } else { diff --git a/src/m365/purview/commands/retentioneventtype/retentioneventtype-remove.spec.ts b/src/m365/purview/commands/retentioneventtype/retentioneventtype-remove.spec.ts index 0059c2781af..da43c47e01c 100644 --- a/src/m365/purview/commands/retentioneventtype/retentioneventtype-remove.spec.ts +++ b/src/m365/purview/commands/retentioneventtype/retentioneventtype-remove.spec.ts @@ -127,7 +127,7 @@ describe(commands.RETENTIONEVENTTYPE_REMOVE, () => { throw 'Invalid Request'; }); - await command.action(logger, { options: { id: validId, confirm: true } }); + await command.action(logger, { options: { id: validId, force: true } }); }); it('handles error when retention event type does not exist', async () => { @@ -148,7 +148,7 @@ describe(commands.RETENTIONEVENTTYPE_REMOVE, () => { await assert.rejects(command.action(logger, { options: { id: validId, - confirm: true + force: true } }), new CommandError(`There is no rule matching identity 'ca0e1f8d-4e42-4a81-be85-022502d70c4f'.`)); }); diff --git a/src/m365/purview/commands/retentioneventtype/retentioneventtype-remove.ts b/src/m365/purview/commands/retentioneventtype/retentioneventtype-remove.ts index 68d21c54542..3287098bd98 100644 --- a/src/m365/purview/commands/retentioneventtype/retentioneventtype-remove.ts +++ b/src/m365/purview/commands/retentioneventtype/retentioneventtype-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class PurviewRetentionEventTypeRemoveCommand extends GraphCommand { @@ -35,7 +35,7 @@ class PurviewRetentionEventTypeRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -46,7 +46,7 @@ class PurviewRetentionEventTypeRemoveCommand extends GraphCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -64,7 +64,7 @@ class PurviewRetentionEventTypeRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeRetentionEventType(args.options); } else { diff --git a/src/m365/purview/commands/retentionlabel/retentionlabel-remove.spec.ts b/src/m365/purview/commands/retentionlabel/retentionlabel-remove.spec.ts index f805f45ee4d..f43abc66410 100644 --- a/src/m365/purview/commands/retentionlabel/retentionlabel-remove.spec.ts +++ b/src/m365/purview/commands/retentionlabel/retentionlabel-remove.spec.ts @@ -152,7 +152,7 @@ describe(commands.RETENTIONLABEL_REMOVE, () => { await command.action(logger, { options: { id: validId, - confirm: true + force: true } }); }); @@ -163,7 +163,7 @@ describe(commands.RETENTIONLABEL_REMOVE, () => { await assert.rejects(command.action(logger, { options: { id: validId, - confirm: true + force: true } }), new CommandError("An error has occurred")); }); diff --git a/src/m365/purview/commands/retentionlabel/retentionlabel-remove.ts b/src/m365/purview/commands/retentionlabel/retentionlabel-remove.ts index cd2505f58cf..49a18b3aafd 100644 --- a/src/m365/purview/commands/retentionlabel/retentionlabel-remove.ts +++ b/src/m365/purview/commands/retentionlabel/retentionlabel-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class PurviewRetentionLabelRemoveCommand extends GraphCommand { @@ -35,7 +35,7 @@ class PurviewRetentionLabelRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -46,7 +46,7 @@ class PurviewRetentionLabelRemoveCommand extends GraphCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -64,7 +64,7 @@ class PurviewRetentionLabelRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeRetentionLabel(args); } else { diff --git a/src/m365/search/commands/externalconnection/externalconnection-remove.spec.ts b/src/m365/search/commands/externalconnection/externalconnection-remove.spec.ts index bbe6c5c7edd..ac130b52705 100644 --- a/src/m365/search/commands/externalconnection/externalconnection-remove.spec.ts +++ b/src/m365/search/commands/externalconnection/externalconnection-remove.spec.ts @@ -134,7 +134,7 @@ describe(commands.EXTERNALCONNECTION_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: "contosohr", confirm: true } }); + await command.action(logger, { options: { id: "contosohr", force: true } }); }); it('removes external connection with specified ID', async () => { @@ -145,7 +145,7 @@ describe(commands.EXTERNALCONNECTION_REMOVE, () => { throw ''; }); - await command.action(logger, { options: { id: "contosohr", confirm: true } }); + await command.action(logger, { options: { id: "contosohr", force: true } }); }); it('removes external connection with specified name', async () => { @@ -171,7 +171,7 @@ describe(commands.EXTERNALCONNECTION_REMOVE, () => { throw ''; }); - await command.action(logger, { options: { name: "Contoso HR", confirm: true } }); + await command.action(logger, { options: { name: "Contoso HR", force: true } }); }); it('fails to get external connection by name when it does not exists', async () => { @@ -187,7 +187,7 @@ describe(commands.EXTERNALCONNECTION_REMOVE, () => { await assert.rejects(command.action(logger, { options: { name: "Fabrikam HR", - confirm: true + force: true } } as any), new CommandError("The specified connection does not exist in Microsoft Search")); }); @@ -214,7 +214,7 @@ describe(commands.EXTERNALCONNECTION_REMOVE, () => { await assert.rejects(command.action(logger, { options: { name: "My HR", - confirm: true + force: true } } as any), new CommandError("Multiple external connections with name My HR found. Please disambiguate (IDs): fabrikamhr, contosohr")); }); diff --git a/src/m365/search/commands/externalconnection/externalconnection-remove.ts b/src/m365/search/commands/externalconnection/externalconnection-remove.ts index ec39baebffc..95a21cb761c 100644 --- a/src/m365/search/commands/externalconnection/externalconnection-remove.ts +++ b/src/m365/search/commands/externalconnection/externalconnection-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id?: string; name?: string; - confirm?: boolean; + force?: boolean; } class SearchExternalConnectionRemoveCommand extends GraphCommand { @@ -38,7 +38,7 @@ class SearchExternalConnectionRemoveCommand extends GraphCommand { Object.assign(this.telemetryProperties, { id: typeof args.options.id !== 'undefined', name: typeof args.options.name !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -47,7 +47,7 @@ class SearchExternalConnectionRemoveCommand extends GraphCommand { this.options.unshift( { option: '--id [id]' }, { option: '--name [name]' }, - { option: '--confirm' } + { option: '-f, --force' } ); } @@ -82,7 +82,7 @@ class SearchExternalConnectionRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeExternalConnection(args); } else { diff --git a/src/m365/spo/commands/app/app-remove.spec.ts b/src/m365/spo/commands/app/app-remove.spec.ts index a15a2ecf619..20f74d79256 100644 --- a/src/m365/spo/commands/app/app-remove.spec.ts +++ b/src/m365/spo/commands/app/app-remove.spec.ts @@ -89,7 +89,7 @@ describe(commands.APP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', confirm: true } }); + await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/tenantappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/remove`) > -1 && @@ -116,7 +116,7 @@ describe(commands.APP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', confirm: true } }); + await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/tenantappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/remove`) > -1 && @@ -143,7 +143,7 @@ describe(commands.APP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { appCatalogScope: 'sitecollection', id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', confirm: true } }); + await command.action(logger, { options: { appCatalogScope: 'sitecollection', id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/sitecollectionappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/remove`) > -1 && @@ -232,7 +232,7 @@ describe(commands.APP_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError("Exception of type 'Microsoft.SharePoint.Client.ResourceNotFoundException' was thrown.")); }); @@ -250,7 +250,7 @@ describe(commands.APP_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('An error has occurred')); }); @@ -268,7 +268,7 @@ describe(commands.APP_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('{"message":"An error has occurred"}')); }); @@ -295,7 +295,7 @@ describe(commands.APP_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/spo/commands/app/app-remove.ts b/src/m365/spo/commands/app/app-remove.ts index 171aece28d6..03fcd68e683 100644 --- a/src/m365/spo/commands/app/app-remove.ts +++ b/src/m365/spo/commands/app/app-remove.ts @@ -15,7 +15,7 @@ interface CommandArgs { interface Options extends GlobalOptions { appCatalogScope?: string; appCatalogUrl?: string; - confirm?: boolean; + force?: boolean; id: string; } @@ -40,7 +40,7 @@ class SpoAppRemoveCommand extends SpoAppBaseCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { appCatalogUrl: (!(!args.options.appCatalogUrl)).toString(), - confirm: (!(!args.options.confirm)).toString(), + force: (!(!args.options.force)).toString(), appCatalogScope: args.options.appCatalogScope || 'tenant' }); }); @@ -59,7 +59,7 @@ class SpoAppRemoveCommand extends SpoAppBaseCommand { autocomplete: ['tenant', 'sitecollection'] }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -118,7 +118,7 @@ class SpoAppRemoveCommand extends SpoAppBaseCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeApp(); } else { diff --git a/src/m365/spo/commands/app/app-retract.spec.ts b/src/m365/spo/commands/app/app-retract.spec.ts index 082487a42d5..f0079e2464a 100644 --- a/src/m365/spo/commands/app/app-retract.spec.ts +++ b/src/m365/spo/commands/app/app-retract.spec.ts @@ -89,7 +89,7 @@ describe(commands.APP_RETRACT, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', confirm: true } }); + await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/tenantappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/retract`) > -1 && @@ -116,7 +116,7 @@ describe(commands.APP_RETRACT, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', confirm: true } }); + await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/tenantappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/retract`) > -1 && @@ -143,7 +143,7 @@ describe(commands.APP_RETRACT, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com/sites/apps', confirm: true } }); + await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com/sites/apps', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`https://contoso.sharepoint.com/sites/apps/_api/web/tenantappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/retract`) > -1 && @@ -170,7 +170,7 @@ describe(commands.APP_RETRACT, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com/sites/site1', appCatalogScope: 'sitecollection', confirm: true } }); + await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com/sites/site1', appCatalogScope: 'sitecollection', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`https://contoso.sharepoint.com/sites/site1/_api/web/sitecollectionappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/retract`) > -1 && @@ -258,7 +258,7 @@ describe(commands.APP_RETRACT, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError("Exception of type 'Microsoft.SharePoint.Client.ResourceNotFoundException' was thrown.")); }); @@ -276,7 +276,7 @@ describe(commands.APP_RETRACT, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('An error has occurred')); }); @@ -294,7 +294,7 @@ describe(commands.APP_RETRACT, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('{"message":"An error has occurred"}')); }); @@ -321,7 +321,7 @@ describe(commands.APP_RETRACT, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', appCatalogUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/spo/commands/app/app-retract.ts b/src/m365/spo/commands/app/app-retract.ts index c3a3db67801..64ea0fc74f8 100644 --- a/src/m365/spo/commands/app/app-retract.ts +++ b/src/m365/spo/commands/app/app-retract.ts @@ -16,7 +16,7 @@ interface Options extends GlobalOptions { id: string; appCatalogScope?: string; appCatalogUrl?: string; - confirm?: boolean; + force?: boolean; } class SpoAppRetractCommand extends SpoAppBaseCommand { @@ -40,7 +40,7 @@ class SpoAppRetractCommand extends SpoAppBaseCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { appCatalogUrl: (!(!args.options.appCatalogUrl)).toString(), - confirm: (!(!args.options.confirm)).toString(), + force: (!(!args.options.force)).toString(), appCatalogScope: args.options.appCatalogScope || 'tenant' }); }); @@ -59,7 +59,7 @@ class SpoAppRetractCommand extends SpoAppBaseCommand { autocomplete: ['tenant', 'sitecollection'] }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -117,7 +117,7 @@ class SpoAppRetractCommand extends SpoAppBaseCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await retractApp(); } else { diff --git a/src/m365/spo/commands/app/app-uninstall.spec.ts b/src/m365/spo/commands/app/app-uninstall.spec.ts index 31dc18eb746..eb6b2b53efb 100644 --- a/src/m365/spo/commands/app/app-uninstall.spec.ts +++ b/src/m365/spo/commands/app/app-uninstall.spec.ts @@ -88,7 +88,7 @@ describe(commands.APP_UNINSTALL, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', confirm: true } }); + await command.action(logger, { options: { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/tenantappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/uninstall`) > -1 && @@ -120,7 +120,7 @@ describe(commands.APP_UNINSTALL, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', confirm: true } }); + await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/tenantappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/uninstall`) > -1 && @@ -152,7 +152,7 @@ describe(commands.APP_UNINSTALL, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', confirm: true, appCatalogScope: 'sitecollection' } }); + await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', force: true, appCatalogScope: 'sitecollection' } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/sitecollectionappcatalog/AvailableApps/GetById('b2307a39-e878-458b-bc90-03bc578531d6')/uninstall`) > -1 && @@ -245,7 +245,7 @@ describe(commands.APP_UNINSTALL, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError("Exception of type 'Microsoft.SharePoint.Client.ResourceNotFoundException' was thrown.")); }); @@ -278,7 +278,7 @@ describe(commands.APP_UNINSTALL, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('Another job exists for this app instance. Please retry after that job is done.')); }); @@ -300,7 +300,7 @@ describe(commands.APP_UNINSTALL, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('An error has occurred')); }); @@ -322,7 +322,7 @@ describe(commands.APP_UNINSTALL, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('{"message":"An error has occurred"}')); }); @@ -353,7 +353,7 @@ describe(commands.APP_UNINSTALL, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', siteUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/spo/commands/app/app-uninstall.ts b/src/m365/spo/commands/app/app-uninstall.ts index 026cc1831ab..7b64932f748 100644 --- a/src/m365/spo/commands/app/app-uninstall.ts +++ b/src/m365/spo/commands/app/app-uninstall.ts @@ -14,7 +14,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; siteUrl: string; - confirm?: boolean; + force?: boolean; appCatalogScope?: string; } @@ -38,7 +38,7 @@ class SpoAppUninstallCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString(), + force: (!(!args.options.force)).toString(), appCatalogScope: args.options.appCatalogScope || 'tenant' }); }); @@ -57,7 +57,7 @@ class SpoAppUninstallCommand extends SpoCommand { autocomplete: ['tenant', 'sitecollection'] }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -104,7 +104,7 @@ class SpoAppUninstallCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await uninstallApp(); } else { diff --git a/src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.spec.ts b/src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.spec.ts index 8a02dd4e5ad..46f01f7451c 100644 --- a/src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.spec.ts +++ b/src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.spec.ts @@ -225,7 +225,7 @@ describe(commands.APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects( command.action(logger, { - options: { id: id, webUrl: webUrl, confirm: true } + options: { id: id, webUrl: webUrl, force: true } } ), new CommandError(`No application customizer with id '${id}' found`)); }); @@ -240,7 +240,7 @@ describe(commands.APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects( command.action(logger, { - options: { title: title, webUrl: webUrl, confirm: true } + options: { title: title, webUrl: webUrl, force: true } } ), new CommandError(`No application customizer with title '${title}' found`)); }); @@ -255,7 +255,7 @@ describe(commands.APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects( command.action(logger, { - options: { clientSideComponentId: clientSideComponentId, webUrl: webUrl, confirm: true } + options: { clientSideComponentId: clientSideComponentId, webUrl: webUrl, force: true } } ), new CommandError(`No application customizer with ClientSideComponentId '${clientSideComponentId}' found`)); }); @@ -270,7 +270,7 @@ describe(commands.APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects( command.action(logger, { - options: { title: title, webUrl: webUrl, scope: 'Site', confirm: true } + options: { title: title, webUrl: webUrl, scope: 'Site', force: true } } ), new CommandError(`Multiple application customizer with title '${title}' found. Please disambiguate using IDs: ${os.EOL}${multipleResponse.value.map(a => `- ${a.Id}`).join(os.EOL)}`)); }); @@ -285,7 +285,7 @@ describe(commands.APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects( command.action(logger, { - options: { clientSideComponentId: clientSideComponentId, webUrl: webUrl, scope: 'Site', confirm: true } + options: { clientSideComponentId: clientSideComponentId, webUrl: webUrl, scope: 'Site', force: true } } ), new CommandError(`Multiple application customizer with ClientSideComponentId '${clientSideComponentId}' found. Please disambiguate using IDs: ${os.EOL}${multipleResponse.value.map(a => `- ${a.Id}`).join(os.EOL)}`)); }); @@ -317,7 +317,7 @@ describe(commands.APPLICATIONCUSTOMIZER_REMOVE, () => { }); const deleteCallsSpy: sinon.SinonStub = defaultDeleteCallsStub(); - await command.action(logger, { options: { verbose: true, id: id, webUrl: webUrl, scope: 'Site', confirm: true } } as any); + await command.action(logger, { options: { verbose: true, id: id, webUrl: webUrl, scope: 'Site', force: true } } as any); assert(deleteCallsSpy.calledOnce); }); @@ -333,7 +333,7 @@ describe(commands.APPLICATIONCUSTOMIZER_REMOVE, () => { }); const deleteCallsSpy: sinon.SinonStub = defaultDeleteCallsStub(); - await command.action(logger, { options: { verbose: true, clientSideComponentId: clientSideComponentId, webUrl: webUrl, scope: 'Web', confirm: true } } as any); + await command.action(logger, { options: { verbose: true, clientSideComponentId: clientSideComponentId, webUrl: webUrl, scope: 'Web', force: true } } as any); assert(deleteCallsSpy.calledOnce); }); }); \ No newline at end of file diff --git a/src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.ts b/src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.ts index 74904228dab..147b9e4d9be 100644 --- a/src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.ts +++ b/src/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.ts @@ -20,7 +20,7 @@ interface Options extends GlobalOptions { id?: string; clientSideComponentId?: string; scope?: string; - confirm?: boolean; + force?: boolean; } class SpoApplicationCustomizerRemoveCommand extends SpoCommand { @@ -61,7 +61,7 @@ class SpoApplicationCustomizerRemoveCommand extends SpoCommand { option: '-s, --scope [scope]', autocomplete: this.allowedScopes }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -73,7 +73,7 @@ class SpoApplicationCustomizerRemoveCommand extends SpoCommand { id: typeof args.options.id !== 'undefined', clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined', scope: typeof args.options.scope !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -106,7 +106,7 @@ class SpoApplicationCustomizerRemoveCommand extends SpoCommand { public async commandAction(logger: Logger, args: CommandArgs): Promise { try { - if (args.options.confirm) { + if (args.options.force) { return await this.removeApplicationCustomizer(logger, args.options); } diff --git a/src/m365/spo/commands/cdn/cdn-origin-remove.spec.ts b/src/m365/spo/commands/cdn/cdn-origin-remove.spec.ts index 2213cf5cff5..7ba2da2d7c3 100644 --- a/src/m365/spo/commands/cdn/cdn-origin-remove.spec.ts +++ b/src/m365/spo/commands/cdn/cdn-origin-remove.spec.ts @@ -95,7 +95,7 @@ describe(commands.CDN_ORIGIN_REMOVE, () => { }); it('removes existing CDN origin from the public CDN when Public type specified without prompting with confirmation argument', async () => { - await command.action(logger, { options: { origin: '*/cdn', confirm: true, type: 'Public' } }); + await command.action(logger, { options: { origin: '*/cdn', force: true, type: 'Public' } }); let deleteRequestIssued = false; requests.forEach(r => { if (r.url.indexOf('/_vti_bin/client.svc/ProcessQuery') > -1 && @@ -109,7 +109,7 @@ describe(commands.CDN_ORIGIN_REMOVE, () => { }); it('removes existing CDN origin from the private CDN when Private type specified without prompting with confirmation argument', async () => { - await assert.rejects(command.action(logger, { options: { origin: '*/cdn', confirm: true, type: 'Private' } })); + await assert.rejects(command.action(logger, { options: { origin: '*/cdn', force: true, type: 'Private' } })); let deleteRequestIssued = false; requests.forEach(r => { if (r.url.indexOf('/_vti_bin/client.svc/ProcessQuery') > -1 && @@ -123,7 +123,7 @@ describe(commands.CDN_ORIGIN_REMOVE, () => { }); it('removes existing CDN origin from the private CDN when Private type specified without prompting with confirmation argument (debug)', async () => { - await assert.rejects(command.action(logger, { options: { debug: true, origin: '*/cdn', confirm: true, type: 'Private' } })); + await assert.rejects(command.action(logger, { options: { debug: true, origin: '*/cdn', force: true, type: 'Private' } })); let deleteRequestIssued = false; requests.forEach(r => { if (r.url.indexOf('/_vti_bin/client.svc/ProcessQuery') > -1 && @@ -137,7 +137,7 @@ describe(commands.CDN_ORIGIN_REMOVE, () => { }); it('removes existing CDN origin from the public CDN when no type specified without prompting with confirmation argument', async () => { - await command.action(logger, { options: { origin: '*/cdn', confirm: true } }); + await command.action(logger, { options: { origin: '*/cdn', force: true } }); let deleteRequestIssued = false; requests.forEach(r => { if (r.url.indexOf('/_vti_bin/client.svc/ProcessQuery') > -1 && @@ -206,14 +206,14 @@ describe(commands.CDN_ORIGIN_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, origin: '*/cdn', confirm: true } } as any), new CommandError('An error has occurred')); + await assert.rejects(command.action(logger, { options: { debug: true, origin: '*/cdn', force: true } } as any), new CommandError('An error has occurred')); }); it('correctly handles a random API error', async () => { sinonUtil.restore(request.post); sinon.stub(request, 'post').rejects(new Error('An error has occurred')); - await assert.rejects(command.action(logger, { options: { origin: '*/cdn', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { origin: '*/cdn', force: true } } as any), new CommandError('An error has occurred')); }); @@ -221,7 +221,7 @@ describe(commands.CDN_ORIGIN_REMOVE, () => { const options = command.options; let containsConfirmOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsConfirmOption = true; } }); diff --git a/src/m365/spo/commands/cdn/cdn-origin-remove.ts b/src/m365/spo/commands/cdn/cdn-origin-remove.ts index 0cbaf6887de..adc73560ee5 100644 --- a/src/m365/spo/commands/cdn/cdn-origin-remove.ts +++ b/src/m365/spo/commands/cdn/cdn-origin-remove.ts @@ -15,7 +15,7 @@ interface CommandArgs { interface Options extends GlobalOptions { type: string; origin: string; - confirm?: boolean; + force?: boolean; } class SpoCdnOriginRemoveCommand extends SpoCommand { @@ -39,7 +39,7 @@ class SpoCdnOriginRemoveCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { cdnType: args.options.type || 'Public', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -54,7 +54,7 @@ class SpoCdnOriginRemoveCommand extends SpoCommand { option: '-r, --origin ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -108,7 +108,7 @@ class SpoCdnOriginRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { if (this.debug) { logger.logToStderr('Confirmation suppressed through the confirm option. Removing CDN origin...'); } diff --git a/src/m365/spo/commands/commandset/commandset-remove.spec.ts b/src/m365/spo/commands/commandset/commandset-remove.spec.ts index 237ba474d7c..6347298c599 100644 --- a/src/m365/spo/commands/commandset/commandset-remove.spec.ts +++ b/src/m365/spo/commands/commandset/commandset-remove.spec.ts @@ -238,7 +238,7 @@ describe(commands.COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - webUrl: validUrl, id: validId, confirm: true + webUrl: validUrl, id: validId, force: true } }), new CommandError(`No user commandsets with id '${validId}' found`)); }); @@ -254,7 +254,7 @@ describe(commands.COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - webUrl: validUrl, title: validTitle, confirm: true + webUrl: validUrl, title: validTitle, force: true } }), new CommandError(`No user commandsets with title '${validTitle}' found`)); }); @@ -273,7 +273,7 @@ describe(commands.COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - webUrl: validUrl, title: validTitle, confirm: true + webUrl: validUrl, title: validTitle, force: true } }), new CommandError(`Multiple user commandsets with title '${validTitle}' found. Please disambiguate using IDs: ${commandsetMultiResponse.value[0].Id}, ${commandsetMultiResponse.value[1].Id}`)); }); @@ -289,7 +289,7 @@ describe(commands.COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - webUrl: validUrl, clientSideComponentId: validClientSideComponentId, confirm: true + webUrl: validUrl, clientSideComponentId: validClientSideComponentId, force: true } }), new CommandError(`No user commandsets with ClientSideComponentId '${validClientSideComponentId}' found`)); }); @@ -308,7 +308,7 @@ describe(commands.COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - webUrl: validUrl, clientSideComponentId: validClientSideComponentId, confirm: true + webUrl: validUrl, clientSideComponentId: validClientSideComponentId, force: true } }), new CommandError(`Multiple user commandsets with ClientSideComponentId '${validClientSideComponentId}' found. Please disambiguate using IDs: ${commandsetMultiResponse.value[0].Id}, ${commandsetMultiResponse.value[1].Id}`)); }); @@ -389,7 +389,7 @@ describe(commands.COMMANDSET_REMOVE, () => { throw `Invalid request`; }); - await command.action(logger, { options: { webUrl: validUrl, title: validTitle, confirm: true } }); + await command.action(logger, { options: { webUrl: validUrl, title: validTitle, force: true } }); }); @@ -413,7 +413,7 @@ describe(commands.COMMANDSET_REMOVE, () => { throw `Invalid request`; }); - await command.action(logger, { options: { webUrl: validUrl, clientSideComponentId: validClientSideComponentId, confirm: true } }); + await command.action(logger, { options: { webUrl: validUrl, clientSideComponentId: validClientSideComponentId, force: true } }); }); it('offers autocomplete for the scope option', () => { @@ -442,7 +442,7 @@ describe(commands.COMMANDSET_REMOVE, () => { throw error; }); - await assert.rejects(command.action(logger, { options: { webUrl: validUrl, id: validId, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { webUrl: validUrl, id: validId, force: true } } as any), new CommandError(`Something went wrong removing the commandset`)); }); }); \ No newline at end of file diff --git a/src/m365/spo/commands/commandset/commandset-remove.ts b/src/m365/spo/commands/commandset/commandset-remove.ts index 756689843c0..9289d769fca 100644 --- a/src/m365/spo/commands/commandset/commandset-remove.ts +++ b/src/m365/spo/commands/commandset/commandset-remove.ts @@ -19,7 +19,7 @@ export interface Options extends GlobalOptions { id?: string; clientSideComponentId?: string; scope?: string; - confirm?: boolean; + force?: boolean; } class SpoCommandSetRemoveCommand extends SpoCommand { @@ -49,7 +49,7 @@ class SpoCommandSetRemoveCommand extends SpoCommand { id: typeof args.options.id !== 'undefined', clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined', scope: typeof args.options.scope !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -72,7 +72,7 @@ class SpoCommandSetRemoveCommand extends SpoCommand { option: '-s, --scope [scope]', autocomplete: SpoCommandSetRemoveCommand.scopes }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -108,7 +108,7 @@ class SpoCommandSetRemoveCommand extends SpoCommand { logger.logToStderr(`Removing ListView Command Set ${args.options.clientSideComponentId || args.options.title || args.options.id} to site '${args.options.webUrl}'...`); } - if (args.options.confirm) { + if (args.options.force) { await this.deleteCommandset(args); } else { diff --git a/src/m365/spo/commands/contenttype/contenttype-field-remove.spec.ts b/src/m365/spo/commands/contenttype/contenttype-field-remove.spec.ts index 2ab152f97af..677f1cbe79d 100644 --- a/src/m365/spo/commands/contenttype/contenttype-field-remove.spec.ts +++ b/src/m365/spo/commands/contenttype/contenttype-field-remove.spec.ts @@ -221,7 +221,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: false, - confirm: true + force: true } } as any); assert(postCallbackStub.called); @@ -234,7 +234,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: false, - confirm: false + force: false } } as any); let promptIssued = false; @@ -283,7 +283,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: false, - confirm: false, + force: false, debug: true } } as any); @@ -320,7 +320,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, - confirm: true + force: true } } as any); assert(loggerLogSpy.notCalled); @@ -353,7 +353,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, - confirm: false + force: false } } as any); assert(postCallbackStub.called); @@ -369,7 +369,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, - confirm: false + force: false } } as any); assert(postCallbackStub.notCalled); @@ -383,7 +383,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, - confirm: false, + force: false, debug: true } } as any); @@ -406,7 +406,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, - confirm: false, + force: false, debug: true } } as any); @@ -424,7 +424,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, - confirm: false, + force: false, debug: true } } as any); @@ -439,7 +439,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { await command.action(logger, { options: { webUrl: WEB_URL, listTitle: LIST_TITLE, contentTypeId: LIST_CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, - confirm: true + force: true } } as any); assert(postCallbackStub.called); @@ -453,7 +453,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { await command.action(logger, { options: { webUrl: WEB_URL, listId: LIST_ID, contentTypeId: LIST_CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, - confirm: true + force: true } } as any); assert(postCallbackStub.called); @@ -467,7 +467,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { await command.action(logger, { options: { webUrl: WEB_URL, listUrl: LIST_URL, contentTypeId: LIST_CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, - confirm: true + force: true } } as any); assert(postCallbackStub.called); @@ -503,7 +503,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, listTitle: LIST_TITLE, contentTypeId: LIST_CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: false, - confirm: true + force: true } } as any); assert(postCallbackStub.called); @@ -521,7 +521,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, listTitle: LIST_TITLE, contentTypeId: LIST_CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: false, - confirm: false + force: false } } as any); assert(postCallbackStub.notCalled); @@ -537,7 +537,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, listTitle: LIST_TITLE, contentTypeId: LIST_CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: false, - confirm: true, + force: true, debug: true } } as any); @@ -637,7 +637,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, - confirm: true + force: true } } as any), new CommandError('Unknown Error')); }); @@ -646,7 +646,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { sinon.stub(request, 'get').callsFake(getStubCalls); sinon.stub(request, 'post').callsFake(postStubFailedCalls); - await assert.rejects(command.action(logger, { options: { debug: true, webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, force: true } } as any), new CommandError('Unknown Error')); }); @@ -661,7 +661,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, - confirm: false + force: false } } as any), new CommandError('Unknown Error')); }); @@ -674,7 +674,7 @@ describe(commands.CONTENTTYPE_FIELD_REMOVE, () => { options: { webUrl: WEB_URL, contentTypeId: CONTENT_TYPE_ID, fieldLinkId: FIELD_LINK_ID, updateChildContentTypes: true, - confirm: true + force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/spo/commands/contenttype/contenttype-field-remove.ts b/src/m365/spo/commands/contenttype/contenttype-field-remove.ts index ebe272351e6..e301827e6df 100644 --- a/src/m365/spo/commands/contenttype/contenttype-field-remove.ts +++ b/src/m365/spo/commands/contenttype/contenttype-field-remove.ts @@ -21,7 +21,7 @@ interface Options extends GlobalOptions { listTitle?: string; listUrl?: string; updateChildContentTypes?: boolean; - confirm?: boolean; + force?: boolean; } class SpoContentTypeFieldRemoveCommand extends SpoCommand { @@ -49,7 +49,7 @@ class SpoContentTypeFieldRemoveCommand extends SpoCommand { listId: typeof args.options.listId !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', updateChildContentTypes: !!args.options.updateChildContentTypes, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -72,13 +72,13 @@ class SpoContentTypeFieldRemoveCommand extends SpoCommand { option: '-i, --contentTypeId ' }, { - option: '-f, --fieldLinkId ' + option: '--fieldLinkId ' }, { option: '-c, --updateChildContentTypes' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -198,7 +198,7 @@ class SpoContentTypeFieldRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeFieldLink(); } else { diff --git a/src/m365/spo/commands/contenttype/contenttype-field-set.ts b/src/m365/spo/commands/contenttype/contenttype-field-set.ts index e6a5407b2b2..810e4a4bd49 100644 --- a/src/m365/spo/commands/contenttype/contenttype-field-set.ts +++ b/src/m365/spo/commands/contenttype/contenttype-field-set.ts @@ -67,7 +67,7 @@ class SpoContentTypeFieldSetCommand extends SpoCommand { option: '-c, --contentTypeId ' }, { - option: '-f, --id ' + option: '--id ' }, { option: '-r, --required [required]', diff --git a/src/m365/spo/commands/contenttype/contenttype-remove.spec.ts b/src/m365/spo/commands/contenttype/contenttype-remove.spec.ts index 89774247e97..2662d9d1fb9 100644 --- a/src/m365/spo/commands/contenttype/contenttype-remove.spec.ts +++ b/src/m365/spo/commands/contenttype/contenttype-remove.spec.ts @@ -83,7 +83,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { }); await command.action(logger, { - options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '0x0100558D85B7216F6A489A499DB361E1AE2F', confirm: false } + options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '0x0100558D85B7216F6A489A499DB361E1AE2F', force: false } } as any); let promptIssued = false; @@ -113,7 +113,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '0x0100558D85B7216F6A489A499DB361E1AE2F', - confirm: false + force: false } } as any); assert(postCallbackStub.called); @@ -139,7 +139,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '0x0100558D85B7216F6A489A499DB361E1AE2F', - confirm: false + force: false } } as any); assert(postCallbackStub.notCalled); @@ -162,7 +162,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'TestContentType', confirm: false } }); + await command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'TestContentType', force: false } }); let promptIssued = false; if (promptOptions && promptOptions.type === 'confirm') { @@ -193,7 +193,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { sinonUtil.restore(Cli.prompt); sinon.stub(Cli, 'prompt').resolves({ continue: true }); - await command.action(logger, { options: { debug: true, verbose: false, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'TestContentType', confirm: false } }); + await command.action(logger, { options: { debug: true, verbose: false, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'TestContentType', force: false } }); assert(getCallbackStub.called); assert(postCallbackStub.called); }); @@ -218,7 +218,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { sinonUtil.restore(Cli.prompt); sinon.stub(Cli, 'prompt').resolves({ continue: false }); - await command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'TestContentType', confirm: false } }); + await command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'TestContentType', force: false } }); assert(postCallbackStub.notCalled); }); @@ -239,7 +239,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'Test Content Type', confirm: true } } as any); + await command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'Test Content Type', force: true } } as any); assert(getStub.called); assert(postStub.called); }); @@ -256,7 +256,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '0x0100558D85B7216F6A489A499DB361E1AE2F', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '0x0100558D85B7216F6A489A499DB361E1AE2F', force: true } } as any), new CommandError('Content type not found')); }); @@ -280,7 +280,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'NonExistentContentType', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'NonExistentContentType', force: true } } as any), new CommandError('Content type not found')); assert(getRequestStub.called); @@ -290,7 +290,7 @@ describe(commands.CONTENTTYPE_REMOVE, () => { it('correctly handles random API error', async () => { sinon.stub(request, 'get').rejects(new Error('An error has occurred')); - await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'NonExistentContentType', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/portal', name: 'NonExistentContentType', force: true } } as any), new CommandError('An error has occurred')); }); @@ -338,17 +338,17 @@ describe(commands.CONTENTTYPE_REMOVE, () => { }); it('passes validation when contenttype id and confirm parameters are provided', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com/sites/sales', id: '0x0100558D85B7216F6A489A499DB361E1AE2F', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com/sites/sales', id: '0x0100558D85B7216F6A489A499DB361E1AE2F', force: true } }, commandInfo); assert.strictEqual(actual, true); }); it('passes validation when contenttype name and confirm parameters are provided', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com/sites/sales', name: 'Test Content Type', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com/sites/sales', name: 'Test Content Type', force: true } }, commandInfo); assert.strictEqual(actual, true); }); it('fails validation when neither name nor id are provided, but confirm is', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com/sites/sales', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com/sites/sales', force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); diff --git a/src/m365/spo/commands/contenttype/contenttype-remove.ts b/src/m365/spo/commands/contenttype/contenttype-remove.ts index 929fd7e1ded..dd916542d48 100644 --- a/src/m365/spo/commands/contenttype/contenttype-remove.ts +++ b/src/m365/spo/commands/contenttype/contenttype-remove.ts @@ -15,7 +15,7 @@ interface Options extends GlobalOptions { webUrl: string; id?: string; name?: string; - confirm?: boolean; + force?: boolean; } class SpoContentTypeRemoveCommand extends SpoCommand { @@ -42,7 +42,7 @@ class SpoContentTypeRemoveCommand extends SpoCommand { Object.assign(this.telemetryProperties, { id: typeof args.options.id !== 'undefined', name: typeof args.options.name !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -59,7 +59,7 @@ class SpoContentTypeRemoveCommand extends SpoCommand { option: '-n, --name [name]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -143,7 +143,7 @@ class SpoContentTypeRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeContentType(); } else { diff --git a/src/m365/spo/commands/customaction/customaction-clear.spec.ts b/src/m365/spo/commands/customaction/customaction-clear.spec.ts index 1f7512b6922..bc1bc146b15 100644 --- a/src/m365/spo/commands/customaction/customaction-clear.spec.ts +++ b/src/m365/spo/commands/customaction/customaction-clear.spec.ts @@ -96,7 +96,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { options: { verbose: false, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); assert(loggerLogSpy.notCalled); @@ -149,7 +149,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { const options = { webUrl: 'https://contoso.sharepoint.com', scope: 'Web', - confirm: true + force: true }; try { @@ -158,7 +158,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { assert(clearScopedCustomActionsSpy.calledWith({ webUrl: 'https://contoso.sharepoint.com', scope: 'Web', - confirm: true + force: true }), 'clearScopedCustomActionsSpy data error'); assert(clearScopedCustomActionsSpy.calledOnce, 'clearScopedCustomActionsSpy calledOnce error'); } @@ -174,7 +174,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { const options = { webUrl: 'https://contoso.sharepoint.com', scope: 'Site', - confirm: true + force: true }; try { @@ -184,7 +184,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { { webUrl: 'https://contoso.sharepoint.com', scope: 'Site', - confirm: true + force: true }), 'clearScopedCustomActionsSpy data error'); assert(clearScopedCustomActionsSpy.calledOnce, 'clearScopedCustomActionsSpy calledOnce error'); } @@ -203,7 +203,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { options: { debug: true, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); assert(clearScopedCustomActionsSpy.calledTwice); @@ -219,7 +219,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { const clearScopedCustomActionsSpy: sinon.SinonSpy = sinon.spy((command as any), 'clearScopedCustomActions'); const options = { webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true }; @@ -237,7 +237,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { const options = { webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true }; await command.action(logger, { options: options } as any); @@ -265,7 +265,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { options: { webUrl: 'https://contoso.sharepoint.com', scope: 'All', - confirm: true + force: true } }), new CommandError(err)); }); @@ -290,7 +290,7 @@ describe(commands.CUSTOMACTION_CLEAR, () => { options: { webUrl: 'https://contoso.sharepoint.com', scope: 'All', - confirm: true + force: true } }), new CommandError(err)); }); diff --git a/src/m365/spo/commands/customaction/customaction-clear.ts b/src/m365/spo/commands/customaction/customaction-clear.ts index 706a9fcaee0..dda5c09decb 100644 --- a/src/m365/spo/commands/customaction/customaction-clear.ts +++ b/src/m365/spo/commands/customaction/customaction-clear.ts @@ -14,7 +14,7 @@ interface CommandArgs { interface Options extends GlobalOptions { webUrl: string; scope?: string; - confirm?: boolean; + force?: boolean; } class SpoCustomActionClearCommand extends SpoCommand { @@ -38,7 +38,7 @@ class SpoCustomActionClearCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { scope: args.options.scope || 'All', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -53,7 +53,7 @@ class SpoCustomActionClearCommand extends SpoCommand { autocomplete: ['Site', 'Web', 'All'] }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -93,7 +93,7 @@ class SpoCustomActionClearCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await clearCustomActions(); } else { diff --git a/src/m365/spo/commands/customaction/customaction-remove.spec.ts b/src/m365/spo/commands/customaction/customaction-remove.spec.ts index 8b1df15196e..5887e49ab1a 100644 --- a/src/m365/spo/commands/customaction/customaction-remove.spec.ts +++ b/src/m365/spo/commands/customaction/customaction-remove.spec.ts @@ -157,7 +157,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { options: { title: 'YourAppCustomizer', webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }), new CommandError(`Multiple user custom actions with title 'YourAppCustomizer' found. Please disambiguate using IDs: a70d8013-3b9f-4601-93a5-0e453ab9a1f3, 63aa745f-b4dd-4055-a4d7-d9032a0cfc59`)); }); @@ -175,7 +175,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { options: { title: 'YourAppCustomizer', webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }), new CommandError(`No user custom action with title 'YourAppCustomizer' found`)); }); @@ -188,7 +188,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { verbose: false, id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); assert(loggerLogSpy.notCalled); @@ -296,7 +296,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', scope: 'Web', - confirm: true + force: true }; try { @@ -306,7 +306,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', scope: 'Web', - confirm: true + force: true }), 'removeScopedCustomActionSpy data error'); assert(removeScopedCustomActionSpy.calledOnce, 'removeScopedCustomActionSpy calledOnce error'); } @@ -323,7 +323,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', scope: 'Site', - confirm: true + force: true }; try { @@ -334,7 +334,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', scope: 'Site', - confirm: true + force: true }), 'removeScopedCustomActionSpy data error'); assert(removeScopedCustomActionSpy.calledOnce, 'removeScopedCustomActionSpy calledOnce error'); } @@ -351,7 +351,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { try { await command.action(logger, { options: { - confirm: true, + force: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', scope: 'All' @@ -388,7 +388,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { debug: true, id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); assert(removeScopedCustomActionSpy.calledTwice); @@ -405,7 +405,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { const options = { id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true }; try { @@ -414,7 +414,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { { id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true })), 'searchAllScopesSpy.calledWith'); assert(searchAllScopesSpy.calledOnce, 'searchAllScopesSpy.calledOnce'); } @@ -446,7 +446,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { id: actionId, webUrl: 'https://contoso.sharepoint.com', scope: 'All', - confirm: true + force: true } }); assert(loggerLogSpy.notCalled); @@ -475,7 +475,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { id: actionId, webUrl: 'https://contoso.sharepoint.com', scope: 'All', - confirm: true + force: true } }); assert(loggerLogToStderrSpy.calledWith(`Custom action with id ${actionId} not found`)); @@ -500,7 +500,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { id: actionId, webUrl: 'https://contoso.sharepoint.com', scope: 'All', - confirm: true + force: true } }), new CommandError(err)); }); @@ -528,7 +528,7 @@ describe(commands.CUSTOMACTION_REMOVE, () => { id: actionId, webUrl: 'https://contoso.sharepoint.com', scope: 'All', - confirm: true + force: true } }), new CommandError(err)); }); diff --git a/src/m365/spo/commands/customaction/customaction-remove.ts b/src/m365/spo/commands/customaction/customaction-remove.ts index 0b7b50d3d27..5ff1188a945 100644 --- a/src/m365/spo/commands/customaction/customaction-remove.ts +++ b/src/m365/spo/commands/customaction/customaction-remove.ts @@ -18,7 +18,7 @@ interface Options extends GlobalOptions { title?: string; webUrl: string; scope?: string; - confirm?: boolean; + force?: boolean; } class SpoCustomActionRemoveCommand extends SpoCommand { @@ -43,7 +43,7 @@ class SpoCustomActionRemoveCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { scope: args.options.scope || 'All', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -64,7 +64,7 @@ class SpoCustomActionRemoveCommand extends SpoCommand { autocomplete: ['Site', 'Web', 'All'] }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -120,7 +120,7 @@ class SpoCustomActionRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeCustomAction(); } else { diff --git a/src/m365/spo/commands/eventreceiver/eventreceiver-remove.spec.ts b/src/m365/spo/commands/eventreceiver/eventreceiver-remove.spec.ts index fcf7e5e60ba..5038eff995c 100644 --- a/src/m365/spo/commands/eventreceiver/eventreceiver-remove.spec.ts +++ b/src/m365/spo/commands/eventreceiver/eventreceiver-remove.spec.ts @@ -178,7 +178,7 @@ describe(commands.EVENTRECEIVER_REMOVE, () => { stderr: '' }); - await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/portal', scope: 'site', name: 'PnP Test Receiver', confirm: true } }); + await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/portal', scope: 'site', name: 'PnP Test Receiver', force: true } }); assert(requestDeleteStub.called); }); @@ -302,7 +302,7 @@ describe(commands.EVENTRECEIVER_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com/sites/portal', scope: 'site', name: 'PnP Test Receiver', - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/spo/commands/eventreceiver/eventreceiver-remove.ts b/src/m365/spo/commands/eventreceiver/eventreceiver-remove.ts index e7d7681d69a..8e2ce37d812 100644 --- a/src/m365/spo/commands/eventreceiver/eventreceiver-remove.ts +++ b/src/m365/spo/commands/eventreceiver/eventreceiver-remove.ts @@ -25,7 +25,7 @@ interface Options extends GlobalOptions { scope?: string; id?: string; name?: string; - confirm?: boolean; + force?: boolean; } class SpoEventreceiverRemoveCommand extends SpoCommand { @@ -55,7 +55,7 @@ class SpoEventreceiverRemoveCommand extends SpoCommand { scope: args.options.scope || 'web', id: typeof args.options.id !== 'undefined', name: typeof args.options.name !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -85,7 +85,7 @@ class SpoEventreceiverRemoveCommand extends SpoCommand { autocomplete: ['web', 'site'] }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -125,7 +125,7 @@ class SpoEventreceiverRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeEventReceiver(args.options); } else { diff --git a/src/m365/spo/commands/externaluser/externaluser-list.ts b/src/m365/spo/commands/externaluser/externaluser-list.ts index 307f499e765..24350e97a3f 100644 --- a/src/m365/spo/commands/externaluser/externaluser-list.ts +++ b/src/m365/spo/commands/externaluser/externaluser-list.ts @@ -53,7 +53,7 @@ class SpoExternalUserListCommand extends SpoCommand { #initOptions(): void { this.options.unshift( { - option: '-f, --filter [filter]' + option: '--filter [filter]' }, { option: '-p, --pageSize [pageSize]' diff --git a/src/m365/spo/commands/field/field-remove.spec.ts b/src/m365/spo/commands/field/field-remove.spec.ts index d4daa174253..ea9c342ccf1 100644 --- a/src/m365/spo/commands/field/field-remove.spec.ts +++ b/src/m365/spo/commands/field/field-remove.spec.ts @@ -171,7 +171,7 @@ describe(commands.FIELD_REMOVE, () => { debug: true, title: actionTitle, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }), new CommandError(err)); }); @@ -191,7 +191,7 @@ describe(commands.FIELD_REMOVE, () => { options: { id: actionId, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); }); @@ -207,7 +207,7 @@ describe(commands.FIELD_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '03e45e84-1992-4d42-9116-26f756012634', listUrl: 'Lists/Events', confirm: true } })); + await assert.rejects(command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '03e45e84-1992-4d42-9116-26f756012634', listUrl: 'Lists/Events', force: true } })); assert.strictEqual(getStub.lastCall.args[0].url, 'https://contoso.sharepoint.com/sites/portal/_api/web/GetList(\'%2Fsites%2Fportal%2FLists%2FEvents\')/fields/getbyid(\'03e45e84-1992-4d42-9116-26f756012634\')'); }); @@ -295,7 +295,7 @@ describe(commands.FIELD_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', group: 'MyGroup', confirm: true } }); + await command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', group: 'MyGroup', force: true } }); assert(getStub.called); assert.strictEqual(deletion.firstCall.args[0].url, 'https://contoso.sharepoint.com/sites/portal/_api/web/fields/getbyid(\'03e45e84-1992-4d42-9116-26f756012634\')'); assert.strictEqual(deletion.secondCall.args[0].url, 'https://contoso.sharepoint.com/sites/portal/_api/web/fields/getbyid(\'03e45e84-1992-4d42-9116-26f756012635\')'); @@ -333,7 +333,7 @@ describe(commands.FIELD_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', group: 'MyGroup1', confirm: true } }); + await command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', group: 'MyGroup1', force: true } }); assert(getStub.called); assert(deletion.notCalled); }); @@ -366,7 +366,7 @@ describe(commands.FIELD_REMOVE, () => { throw error; }); - await assert.rejects(command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', group: 'MyGroup', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', group: 'MyGroup', force: true } } as any), new CommandError('Invalid request')); assert(getStub.called); assert(deletion.notCalled); @@ -417,7 +417,7 @@ describe(commands.FIELD_REMOVE, () => { throw error; }); - await assert.rejects(command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', group: 'MyGroup', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', group: 'MyGroup', force: true } } as any), new CommandError(error.error['odata.error'].message.value)); assert(getStub.called); assert.strictEqual(deletion.firstCall.args[0].url, 'https://contoso.sharepoint.com/sites/portal/_api/web/fields/getbyid(\'03e45e84-1992-4d42-9116-26f756012634\')'); @@ -435,7 +435,7 @@ describe(commands.FIELD_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', title: 'Title', listTitle: 'Documents', confirm: true } }); + await command.action(logger, { options: { debug: true, verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', title: 'Title', listTitle: 'Documents', force: true } }); assert.strictEqual(getStub.lastCall.args[0].url, 'https://contoso.sharepoint.com/sites/portal/_api/web/lists/getByTitle(\'Documents\')/fields/getbyinternalnameortitle(\'Title\')'); }); @@ -450,7 +450,7 @@ describe(commands.FIELD_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/portal', title: 'Title', listTitle: 'Documents', confirm: true } }); + await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/portal', title: 'Title', listTitle: 'Documents', force: true } }); assert.strictEqual(getStub.lastCall.args[0].url, 'https://contoso.sharepoint.com/sites/portal/_api/web/lists/getByTitle(\'Documents\')/fields/getbyinternalnameortitle(\'Title\')'); }); @@ -465,7 +465,7 @@ describe(commands.FIELD_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', title: 'Title', listId: '03e45e84-1992-4d42-9116-26f756012634', confirm: true } }); + await command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', title: 'Title', listId: '03e45e84-1992-4d42-9116-26f756012634', force: true } }); assert.strictEqual(getStub.lastCall.args[0].url, 'https://contoso.sharepoint.com/sites/portal/_api/web/lists(guid\'03e45e84-1992-4d42-9116-26f756012634\')/fields/getbyinternalnameortitle(\'Title\')'); }); @@ -488,7 +488,7 @@ describe(commands.FIELD_REMOVE, () => { }); const actionTitle: string = 'field1'; - await assert.rejects(command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', title: actionTitle, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', title: actionTitle, force: true } } as any), new CommandError(error.error['odata.error'].message.value)); }); @@ -511,7 +511,7 @@ describe(commands.FIELD_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '03e45e84-1992-4d42-9116-26f756012634', listTitle: 'Documents', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '03e45e84-1992-4d42-9116-26f756012634', listTitle: 'Documents', force: true } } as any), new CommandError('Invalid field name. {03e45e84-1992-4d42-9116-26f756012634} /sites/portal/Shared Documents')); }); @@ -534,7 +534,7 @@ describe(commands.FIELD_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '03e45e84-1992-4d42-9116-26f756012634', listTitle: 'Documents', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/portal', id: '03e45e84-1992-4d42-9116-26f756012634', listTitle: 'Documents', force: true } } as any), new CommandError("List 'Documents' does not exist at site with URL 'https://contoso.sharepoint.com/sites/portal'.")); }); @@ -550,7 +550,7 @@ describe(commands.FIELD_REMOVE, () => { }); it('fails validation if both id and title options are not passed', async () => { - const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', confirm: true, listTitle: 'Documents' } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'https://contoso.sharepoint.com', force: true, listTitle: 'Documents' } }, commandInfo); assert.notStrictEqual(actual, true); }); @@ -584,7 +584,7 @@ describe(commands.FIELD_REMOVE, () => { options: { webUrl: 'https://contoso.sharepoint.com', id: 'BC448D63-484F-49C5-AB8C-96B14AA68D50', - confirm: true + force: true } }, commandInfo); assert.strictEqual(actual, true); diff --git a/src/m365/spo/commands/field/field-remove.ts b/src/m365/spo/commands/field/field-remove.ts index 55b64317a0a..f3b078b825d 100644 --- a/src/m365/spo/commands/field/field-remove.ts +++ b/src/m365/spo/commands/field/field-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; id?: string; listId?: string; group?: string; @@ -50,7 +50,7 @@ class SpoFieldRemoveCommand extends SpoCommand { id: typeof args.options.id !== 'undefined', group: typeof args.options.group !== 'undefined', title: typeof args.options.title !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -79,7 +79,7 @@ class SpoFieldRemoveCommand extends SpoCommand { option: '-g, --group [group]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -200,7 +200,7 @@ class SpoFieldRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await prepareRemoval(); } else { diff --git a/src/m365/spo/commands/file/file-add.ts b/src/m365/spo/commands/file/file-add.ts index b89c64c3a71..a3582ffdcf5 100644 --- a/src/m365/spo/commands/file/file-add.ts +++ b/src/m365/spo/commands/file/file-add.ts @@ -103,7 +103,7 @@ class SpoFileAddCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --folder ' + option: '--folder ' }, { option: '-p, --path ' diff --git a/src/m365/spo/commands/file/file-checkin.ts b/src/m365/spo/commands/file/file-checkin.ts index 96d4ed54947..81147271d4f 100644 --- a/src/m365/spo/commands/file/file-checkin.ts +++ b/src/m365/spo/commands/file/file-checkin.ts @@ -60,7 +60,7 @@ class SpoFileCheckinCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --url [url]' + option: '--url [url]' }, { option: '-i, --id [id]' diff --git a/src/m365/spo/commands/file/file-checkout-undo.spec.ts b/src/m365/spo/commands/file/file-checkout-undo.spec.ts index d2bd799d813..a660bde2736 100644 --- a/src/m365/spo/commands/file/file-checkout-undo.spec.ts +++ b/src/m365/spo/commands/file/file-checkout-undo.spec.ts @@ -97,7 +97,7 @@ describe(commands.FILE_CHECKOUT_UNDO, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { webUrl: webUrl, fileUrl: fileUrl, confirm: true, verbose: true } }); + await command.action(logger, { options: { webUrl: webUrl, fileUrl: fileUrl, force: true, verbose: true } }); assert(postStub.called); }); @@ -111,7 +111,7 @@ describe(commands.FILE_CHECKOUT_UNDO, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { webUrl: webUrl, fileUrl: siteRelativeUrl, confirm: true, verbose: true } }); + await command.action(logger, { options: { webUrl: webUrl, fileUrl: siteRelativeUrl, force: true, verbose: true } }); assert(postStub.called); }); @@ -133,7 +133,7 @@ describe(commands.FILE_CHECKOUT_UNDO, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { webUrl: webUrl, fileId: fileId, confirm: true, verbose: true } }), new CommandError('The file "Shared Documents/4.docx" is not checked out.')); + await assert.rejects(command.action(logger, { options: { webUrl: webUrl, fileId: fileId, force: true, verbose: true } }), new CommandError('The file "Shared Documents/4.docx" is not checked out.')); }); it('prompts before undoing checkout when confirmation argument not passed', async () => { diff --git a/src/m365/spo/commands/file/file-checkout-undo.ts b/src/m365/spo/commands/file/file-checkout-undo.ts index c53ef66a398..723d4a8f12f 100644 --- a/src/m365/spo/commands/file/file-checkout-undo.ts +++ b/src/m365/spo/commands/file/file-checkout-undo.ts @@ -16,7 +16,7 @@ interface Options extends GlobalOptions { webUrl: string; fileUrl?: string; fileId?: string; - confirm?: boolean; + force?: boolean; } class SpoFileCheckoutUndoCommand extends SpoCommand { @@ -42,7 +42,7 @@ class SpoFileCheckoutUndoCommand extends SpoCommand { Object.assign(this.telemetryProperties, { fileId: typeof args.options.fileId !== 'undefined', fileUrl: typeof args.options.fileUrl !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -53,13 +53,13 @@ class SpoFileCheckoutUndoCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --fileUrl [fileUrl]' + option: '--fileUrl [fileUrl]' }, { option: '-i, --fileId [fileId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -119,7 +119,7 @@ class SpoFileCheckoutUndoCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await undoCheckout(); } else { diff --git a/src/m365/spo/commands/file/file-checkout.ts b/src/m365/spo/commands/file/file-checkout.ts index f2d9917bb4c..6e9db2a5e2a 100644 --- a/src/m365/spo/commands/file/file-checkout.ts +++ b/src/m365/spo/commands/file/file-checkout.ts @@ -50,7 +50,7 @@ class SpoFileCheckoutCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --url [url]' + option: '--url [url]' }, { option: '-i, --id [id]' diff --git a/src/m365/spo/commands/file/file-list.ts b/src/m365/spo/commands/file/file-list.ts index 0f455bc0e48..b896ec90856 100644 --- a/src/m365/spo/commands/file/file-list.ts +++ b/src/m365/spo/commands/file/file-list.ts @@ -64,10 +64,10 @@ class SpoFileListCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --folder [folder]' + option: '--folder [folder]' }, { - option: '-f, --folderUrl [folderUrl]' + option: '--folderUrl [folderUrl]' }, { option: '--fields [fields]' diff --git a/src/m365/spo/commands/file/file-move.ts b/src/m365/spo/commands/file/file-move.ts index 92b1daf07fc..a7bbe104733 100644 --- a/src/m365/spo/commands/file/file-move.ts +++ b/src/m365/spo/commands/file/file-move.ts @@ -186,7 +186,7 @@ class SpoFileMoveCommand extends SpoCommand { webUrl: contextResponse.WebFullUrl, url: targetFileServerRelativeUrl, recycle: true, - confirm: true, + force: true, debug: this.debug, verbose: this.verbose }; diff --git a/src/m365/spo/commands/file/file-remove.spec.ts b/src/m365/spo/commands/file/file-remove.spec.ts index e7af62b5fad..b41bfebf66e 100644 --- a/src/m365/spo/commands/file/file-remove.spec.ts +++ b/src/m365/spo/commands/file/file-remove.spec.ts @@ -601,7 +601,7 @@ describe(commands.FILE_REMOVE, () => { debug: true, id: actionId, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }), new CommandError(err)); }); @@ -621,7 +621,7 @@ describe(commands.FILE_REMOVE, () => { options: { id: actionId, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); }); @@ -641,7 +641,7 @@ describe(commands.FILE_REMOVE, () => { options: { url: actionUrl, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); }); @@ -662,7 +662,7 @@ describe(commands.FILE_REMOVE, () => { id: actionId, recycle: true, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); }); diff --git a/src/m365/spo/commands/file/file-remove.ts b/src/m365/spo/commands/file/file-remove.ts index c88e163549b..10c57664217 100644 --- a/src/m365/spo/commands/file/file-remove.ts +++ b/src/m365/spo/commands/file/file-remove.ts @@ -17,7 +17,7 @@ export interface Options extends GlobalOptions { id?: string; url?: string; recycle?: boolean; - confirm?: boolean; + force?: boolean; } class SpoFileRemoveCommand extends SpoCommand { @@ -48,7 +48,7 @@ class SpoFileRemoveCommand extends SpoCommand { id: (!(!args.options.id)).toString(), url: (!(!args.options.url)).toString(), recycle: (!(!args.options.recycle)).toString(), - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -68,7 +68,7 @@ class SpoFileRemoveCommand extends SpoCommand { option: '--recycle' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -138,7 +138,7 @@ class SpoFileRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeFile(); } else { diff --git a/src/m365/spo/commands/file/file-rename.ts b/src/m365/spo/commands/file/file-rename.ts index e07e50badeb..d48993b1c84 100644 --- a/src/m365/spo/commands/file/file-rename.ts +++ b/src/m365/spo/commands/file/file-rename.ts @@ -138,7 +138,7 @@ class SpoFileRenameCommand extends SpoCommand { webUrl: webUrl, url: targetFileServerRelativeUrl, recycle: true, - confirm: true, + force: true, debug: this.debug, verbose: this.verbose }; diff --git a/src/m365/spo/commands/file/file-retentionlabel-remove.spec.ts b/src/m365/spo/commands/file/file-retentionlabel-remove.spec.ts index 4d1f03524d8..859db698bfa 100644 --- a/src/m365/spo/commands/file/file-retentionlabel-remove.spec.ts +++ b/src/m365/spo/commands/file/file-retentionlabel-remove.spec.ts @@ -199,7 +199,7 @@ describe(commands.FILE_RETENTIONLABEL_REMOVE, () => { fileId: fileId, webUrl: webUrl, listItemId: 1, - confirm: true + force: true } })); }); @@ -212,7 +212,7 @@ describe(commands.FILE_RETENTIONLABEL_REMOVE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - confirm: true, + force: true, fileUrl: fileUrl, webUrl: webUrl } diff --git a/src/m365/spo/commands/file/file-retentionlabel-remove.ts b/src/m365/spo/commands/file/file-retentionlabel-remove.ts index 830e1c20f38..ea1f1b7acbb 100644 --- a/src/m365/spo/commands/file/file-retentionlabel-remove.ts +++ b/src/m365/spo/commands/file/file-retentionlabel-remove.ts @@ -21,7 +21,7 @@ interface Options extends GlobalOptions { webUrl: string; fileUrl?: string; fileId?: string; - confirm?: boolean; + force?: boolean; } class SpoFileRetentionLabelRemoveCommand extends SpoCommand { @@ -47,7 +47,7 @@ class SpoFileRetentionLabelRemoveCommand extends SpoCommand { Object.assign(this.telemetryProperties, { fileUrl: typeof args.options.fileUrl !== 'undefined', fileId: typeof args.options.fileId !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -64,7 +64,7 @@ class SpoFileRetentionLabelRemoveCommand extends SpoCommand { option: '-i, --fileId [fileId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -92,7 +92,7 @@ class SpoFileRetentionLabelRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeFileRetentionLabel(logger, args); } else { @@ -119,7 +119,7 @@ class SpoFileRetentionLabelRemoveCommand extends SpoCommand { webUrl: args.options.webUrl, listId: fileProperties.listId, listItemId: fileProperties.id, - confirm: true, + force: true, output: 'json', debug: this.debug, verbose: this.verbose diff --git a/src/m365/spo/commands/file/file-roleassignment-remove.spec.ts b/src/m365/spo/commands/file/file-roleassignment-remove.spec.ts index daa0ae64f50..2ac64c61fd3 100644 --- a/src/m365/spo/commands/file/file-roleassignment-remove.spec.ts +++ b/src/m365/spo/commands/file/file-roleassignment-remove.spec.ts @@ -82,22 +82,22 @@ describe(commands.FILE_ROLEASSIGNMENT_REMOVE, () => { }); it('fails validation if the webUrl option is not a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { webUrl: 'foo', fileId: fileId, principalId: principalId, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'foo', fileId: fileId, principalId: principalId, force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if the fileId option is not a valid GUID', async () => { - const actual = await command.validate({ options: { webUrl: webUrl, fileId: 'foo', principalId: principalId, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: webUrl, fileId: 'foo', principalId: principalId, force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if the principalId option is not a number', async () => { - const actual = await command.validate({ options: { webUrl: webUrl, fileId: fileId, principalId: 'Hi', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: webUrl, fileId: fileId, principalId: 'Hi', force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation if webUrl and fileId are valid', async () => { - const actual = await command.validate({ options: { webUrl: webUrl, fileId: '0cd891ef-afce-4e55-b836-fce03286cccf', principalId: principalId, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: webUrl, fileId: '0cd891ef-afce-4e55-b836-fce03286cccf', principalId: principalId, force: true } }, commandInfo); assert.strictEqual(actual, true); }); @@ -188,7 +188,7 @@ describe(commands.FILE_ROLEASSIGNMENT_REMOVE, () => { webUrl: webUrl, fileId: fileId, upn: upn, - confirm: true + force: true } }); }); @@ -225,7 +225,7 @@ describe(commands.FILE_ROLEASSIGNMENT_REMOVE, () => { webUrl: webUrl, fileId: fileId, groupName: groupName, - confirm: true + force: true } }); }); @@ -240,7 +240,7 @@ describe(commands.FILE_ROLEASSIGNMENT_REMOVE, () => { webUrl: webUrl, fileUrl: fileUrl, principalId: principalId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/spo/commands/file/file-roleassignment-remove.ts b/src/m365/spo/commands/file/file-roleassignment-remove.ts index dea583f9894..039749d849f 100644 --- a/src/m365/spo/commands/file/file-roleassignment-remove.ts +++ b/src/m365/spo/commands/file/file-roleassignment-remove.ts @@ -26,7 +26,7 @@ export interface Options extends GlobalOptions { principalId?: number; upn?: string; groupName?: string; - confirm?: boolean; + force?: boolean; } class SpoFileRoleAssignmentRemoveCommand extends SpoCommand { @@ -55,7 +55,7 @@ class SpoFileRoleAssignmentRemoveCommand extends SpoCommand { principalId: typeof args.options.principalId !== 'undefined', upn: typeof args.options.upn !== 'undefined', groupName: typeof args.options.groupName !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -81,7 +81,7 @@ class SpoFileRoleAssignmentRemoveCommand extends SpoCommand { option: '--groupName [groupName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -150,7 +150,7 @@ class SpoFileRoleAssignmentRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeRoleAssignment(); } else { diff --git a/src/m365/spo/commands/file/file-roleinheritance-break.spec.ts b/src/m365/spo/commands/file/file-roleinheritance-break.spec.ts index fcc229dd9e2..509a23d0f0a 100644 --- a/src/m365/spo/commands/file/file-roleinheritance-break.spec.ts +++ b/src/m365/spo/commands/file/file-roleinheritance-break.spec.ts @@ -76,17 +76,17 @@ describe(commands.FILE_ROLEINHERITANCE_RESET, () => { }); it('fails validation if the webUrl option is not a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { webUrl: 'foo', fileId: fileId, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'foo', fileId: fileId, force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if the fileId option is not a valid GUID', async () => { - const actual = await command.validate({ options: { webUrl: webUrl, fileId: 'foo', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: webUrl, fileId: 'foo', force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation if webUrl and fileId are valid', async () => { - const actual = await command.validate({ options: { webUrl: webUrl, fileId: '0cd891ef-afce-4e55-b836-fce03286cccf', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: webUrl, fileId: '0cd891ef-afce-4e55-b836-fce03286cccf', force: true } }, commandInfo); assert.strictEqual(actual, true); }); @@ -135,7 +135,7 @@ describe(commands.FILE_ROLEINHERITANCE_RESET, () => { webUrl: webUrl, fileUrl: fileUrl, clearExistingPermissions: true, - confirm: true + force: true } }); }); @@ -155,7 +155,7 @@ describe(commands.FILE_ROLEINHERITANCE_RESET, () => { webUrl: webUrl, fileUrl: fileUrl, clearExistingPermissions: false, - confirm: true + force: true } }); }); @@ -208,7 +208,7 @@ describe(commands.FILE_ROLEINHERITANCE_RESET, () => { debug: true, webUrl: webUrl, fileUrl: fileUrl, - confirm: true + force: true } }), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/file/file-roleinheritance-break.ts b/src/m365/spo/commands/file/file-roleinheritance-break.ts index 91a6409e1b5..de9eaa62c66 100644 --- a/src/m365/spo/commands/file/file-roleinheritance-break.ts +++ b/src/m365/spo/commands/file/file-roleinheritance-break.ts @@ -20,7 +20,7 @@ interface Options extends GlobalOptions { fileUrl?: string; fileId?: string; clearExistingPermissions?: boolean; - confirm?: boolean; + force?: boolean; } class SpoFileRoleInheritanceBreakCommand extends SpoCommand { @@ -47,7 +47,7 @@ class SpoFileRoleInheritanceBreakCommand extends SpoCommand { fileUrl: typeof args.options.fileUrl !== 'undefined', fileId: typeof args.options.fileId !== 'undefined', clearExistingPermissions: !!args.options.clearExistingPermissions, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -67,7 +67,7 @@ class SpoFileRoleInheritanceBreakCommand extends SpoCommand { option: '-c, --clearExistingPermissions' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -118,7 +118,7 @@ class SpoFileRoleInheritanceBreakCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await breakFileRoleInheritance(); } else { diff --git a/src/m365/spo/commands/file/file-roleinheritance-reset.spec.ts b/src/m365/spo/commands/file/file-roleinheritance-reset.spec.ts index e866231bd96..4d47c12c4b4 100644 --- a/src/m365/spo/commands/file/file-roleinheritance-reset.spec.ts +++ b/src/m365/spo/commands/file/file-roleinheritance-reset.spec.ts @@ -75,17 +75,17 @@ describe(commands.FILE_ROLEINHERITANCE_RESET, () => { }); it('fails validation if the webUrl option is not a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { webUrl: 'foo', fileId: fileId, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'foo', fileId: fileId, force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if the fileId option is not a valid GUID', async () => { - const actual = await command.validate({ options: { webUrl: webUrl, fileId: 'foo', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: webUrl, fileId: 'foo', force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation if webUrl and fileId are valid', async () => { - const actual = await command.validate({ options: { webUrl: webUrl, fileId: '0cd891ef-afce-4e55-b836-fce03286cccf', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: webUrl, fileId: '0cd891ef-afce-4e55-b836-fce03286cccf', force: true } }, commandInfo); assert.strictEqual(actual, true); }); @@ -133,7 +133,7 @@ describe(commands.FILE_ROLEINHERITANCE_RESET, () => { debug: true, webUrl: webUrl, fileUrl: fileUrl, - confirm: true + force: true } }); }); @@ -186,7 +186,7 @@ describe(commands.FILE_ROLEINHERITANCE_RESET, () => { debug: true, webUrl: webUrl, fileUrl: fileUrl, - confirm: true + force: true } }), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/file/file-roleinheritance-reset.ts b/src/m365/spo/commands/file/file-roleinheritance-reset.ts index 022bcb831eb..c7c8778ed96 100644 --- a/src/m365/spo/commands/file/file-roleinheritance-reset.ts +++ b/src/m365/spo/commands/file/file-roleinheritance-reset.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { webUrl: string; fileUrl?: string; fileId?: string; - confirm?: boolean; + force?: boolean; } class SpoFileRoleInheritanceResetCommand extends SpoCommand { @@ -45,7 +45,7 @@ class SpoFileRoleInheritanceResetCommand extends SpoCommand { Object.assign(this.telemetryProperties, { fileUrl: typeof args.options.fileUrl !== 'undefined', fileId: typeof args.options.fileId !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -62,7 +62,7 @@ class SpoFileRoleInheritanceResetCommand extends SpoCommand { option: 'i, --fileId [fileId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -111,7 +111,7 @@ class SpoFileRoleInheritanceResetCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await resetFileRoleInheritance(); } else { diff --git a/src/m365/spo/commands/file/file-sharinginfo-get.ts b/src/m365/spo/commands/file/file-sharinginfo-get.ts index 4b0a0baf661..7926342521a 100644 --- a/src/m365/spo/commands/file/file-sharinginfo-get.ts +++ b/src/m365/spo/commands/file/file-sharinginfo-get.ts @@ -84,7 +84,7 @@ class SpoFileSharingInfoGetCommand extends SpoCommand { option: '-i, --fileId [fileId]' }, { - option: '-f, --fileUrl [fileUrl]' + option: '--fileUrl [fileUrl]' } ); } diff --git a/src/m365/spo/commands/file/file-sharinglink-clear.spec.ts b/src/m365/spo/commands/file/file-sharinglink-clear.spec.ts index 72304ef8bb1..cdd45bd7702 100644 --- a/src/m365/spo/commands/file/file-sharinglink-clear.spec.ts +++ b/src/m365/spo/commands/file/file-sharinglink-clear.spec.ts @@ -162,7 +162,7 @@ describe(commands.FILE_SHARINGLINK_CLEAR, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, webUrl: webUrl, fileUrl: fileUrl, confirm: true } }); + await command.action(logger, { options: { verbose: true, webUrl: webUrl, fileUrl: fileUrl, force: true } }); assert(deleteStub.called); }); diff --git a/src/m365/spo/commands/file/file-sharinglink-clear.ts b/src/m365/spo/commands/file/file-sharinglink-clear.ts index ea8b2fe3e85..94c085962a9 100644 --- a/src/m365/spo/commands/file/file-sharinglink-clear.ts +++ b/src/m365/spo/commands/file/file-sharinglink-clear.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { fileUrl?: string; fileId?: string; scope?: string; - confirm?: boolean; + force?: boolean; } class SpoFileSharingLinkClearCommand extends SpoCommand { @@ -48,7 +48,7 @@ class SpoFileSharingLinkClearCommand extends SpoCommand { fileUrl: typeof args.options.fileUrl !== 'undefined', fileId: typeof args.options.fileId !== 'undefined', scope: typeof args.options.scope !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -69,7 +69,7 @@ class SpoFileSharingLinkClearCommand extends SpoCommand { autocomplete: this.allowedScopes }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -126,7 +126,7 @@ class SpoFileSharingLinkClearCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await clearSharingLinks(); } else { diff --git a/src/m365/spo/commands/file/file-sharinglink-remove.spec.ts b/src/m365/spo/commands/file/file-sharinglink-remove.spec.ts index 20371bffe86..ca56f4719d8 100644 --- a/src/m365/spo/commands/file/file-sharinglink-remove.spec.ts +++ b/src/m365/spo/commands/file/file-sharinglink-remove.spec.ts @@ -187,7 +187,7 @@ describe(commands.FILE_SHARINGLINK_REMOVE, () => { webUrl: webUrl, fileUrl: fileUrl, id: id, - confirm: true + force: true } }); assert(requestDeleteStub.called); @@ -207,7 +207,7 @@ describe(commands.FILE_SHARINGLINK_REMOVE, () => { webUrl: webUrl, fileId: fileId, id: id, - confirm: true, + force: true, verbose: true } } as any), new CommandError(`File Not Found.`)); diff --git a/src/m365/spo/commands/file/file-sharinglink-remove.ts b/src/m365/spo/commands/file/file-sharinglink-remove.ts index b93f03e570f..68dc54c4198 100644 --- a/src/m365/spo/commands/file/file-sharinglink-remove.ts +++ b/src/m365/spo/commands/file/file-sharinglink-remove.ts @@ -16,7 +16,7 @@ interface Options extends GlobalOptions { fileUrl?: string; fileId?: string; id: string; - confirm?: boolean + force?: boolean } class SpoFileSharingLinkRemoveCommand extends SpoCommand { @@ -42,7 +42,7 @@ class SpoFileSharingLinkRemoveCommand extends SpoCommand { Object.assign(this.telemetryProperties, { fileUrl: typeof args.options.fileUrl !== 'undefined', fileId: typeof args.options.fileId !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -62,7 +62,7 @@ class SpoFileSharingLinkRemoveCommand extends SpoCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -111,7 +111,7 @@ class SpoFileSharingLinkRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeSharingLink(); } else { diff --git a/src/m365/spo/commands/file/file-version-clear.spec.ts b/src/m365/spo/commands/file/file-version-clear.spec.ts index 5eeb6458152..27d5a9e0fcd 100644 --- a/src/m365/spo/commands/file/file-version-clear.spec.ts +++ b/src/m365/spo/commands/file/file-version-clear.spec.ts @@ -142,7 +142,7 @@ describe(commands.FILE_VERSION_CLEAR, () => { debug: true, webUrl: validWebUrl, fileUrl: validFileUrl, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -161,7 +161,7 @@ describe(commands.FILE_VERSION_CLEAR, () => { debug: true, webUrl: validWebUrl, fileId: validFileId, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -234,7 +234,7 @@ describe(commands.FILE_VERSION_CLEAR, () => { options: { debug: true, webUrl: validWebUrl, - confirm: true + force: true } }), new CommandError(err)); }); diff --git a/src/m365/spo/commands/file/file-version-clear.ts b/src/m365/spo/commands/file/file-version-clear.ts index 01c74bb02dc..1b7f701eafc 100644 --- a/src/m365/spo/commands/file/file-version-clear.ts +++ b/src/m365/spo/commands/file/file-version-clear.ts @@ -16,7 +16,7 @@ interface Options extends GlobalOptions { webUrl: string; fileUrl?: string; fileId?: string; - confirm?: boolean; + force?: boolean; } class SpoFileVersionClearCommand extends SpoCommand { @@ -42,7 +42,7 @@ class SpoFileVersionClearCommand extends SpoCommand { Object.assign(this.telemetryProperties, { fileUrl: args.options.fileUrl, fileId: args.options.fileId, - confirm: (!!args.options.confirm).toString() + force: (!!args.options.force).toString() }); }); } @@ -59,7 +59,7 @@ class SpoFileVersionClearCommand extends SpoCommand { option: '-i, --fileId [fileId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -86,7 +86,7 @@ class SpoFileVersionClearCommand extends SpoCommand { } try { - if (args.options.confirm) { + if (args.options.force) { await this.clearVersions(args); } else { diff --git a/src/m365/spo/commands/file/file-version-remove.spec.ts b/src/m365/spo/commands/file/file-version-remove.spec.ts index f47bd194a0b..8ce46fdc94d 100644 --- a/src/m365/spo/commands/file/file-version-remove.spec.ts +++ b/src/m365/spo/commands/file/file-version-remove.spec.ts @@ -147,7 +147,7 @@ describe(commands.FILE_VERSION_REMOVE, () => { webUrl: validWebUrl, label: validLabel, fileUrl: validFileUrl, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -167,7 +167,7 @@ describe(commands.FILE_VERSION_REMOVE, () => { webUrl: validWebUrl, label: validLabel, fileId: validFileId, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -242,7 +242,7 @@ describe(commands.FILE_VERSION_REMOVE, () => { debug: true, webUrl: validWebUrl, label: validLabel, - confirm: true + force: true } }), new CommandError(err)); }); diff --git a/src/m365/spo/commands/file/file-version-remove.ts b/src/m365/spo/commands/file/file-version-remove.ts index 21fba35d27f..bf9b0f3c155 100644 --- a/src/m365/spo/commands/file/file-version-remove.ts +++ b/src/m365/spo/commands/file/file-version-remove.ts @@ -17,7 +17,7 @@ interface Options extends GlobalOptions { label: string; fileUrl?: string; fileId?: string; - confirm?: boolean; + force?: boolean; } class SpoFileVersionRemoveCommand extends SpoCommand { @@ -44,7 +44,7 @@ class SpoFileVersionRemoveCommand extends SpoCommand { Object.assign(this.telemetryProperties, { fileUrl: args.options.fileUrl, fileId: args.options.fileId, - confirm: (!!args.options.confirm).toString() + force: (!!args.options.force).toString() }); }); } @@ -64,7 +64,7 @@ class SpoFileVersionRemoveCommand extends SpoCommand { option: '-i, --fileId [fileId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -95,7 +95,7 @@ class SpoFileVersionRemoveCommand extends SpoCommand { } try { - if (args.options.confirm) { + if (args.options.force) { await this.removeVersion(args); } else { diff --git a/src/m365/spo/commands/file/file-version-restore.spec.ts b/src/m365/spo/commands/file/file-version-restore.spec.ts index f06cdf1073b..3fee688f7a2 100644 --- a/src/m365/spo/commands/file/file-version-restore.spec.ts +++ b/src/m365/spo/commands/file/file-version-restore.spec.ts @@ -147,7 +147,7 @@ describe(commands.FILE_VERSION_RESTORE, () => { webUrl: validWebUrl, label: validLabel, fileUrl: validFileUrl, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -167,7 +167,7 @@ describe(commands.FILE_VERSION_RESTORE, () => { webUrl: validWebUrl, label: validLabel, fileId: validFileId, - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -244,7 +244,7 @@ describe(commands.FILE_VERSION_RESTORE, () => { debug: true, webUrl: validWebUrl, label: validLabel, - confirm: true + force: true } }), new CommandError(err)); }); diff --git a/src/m365/spo/commands/file/file-version-restore.ts b/src/m365/spo/commands/file/file-version-restore.ts index 73a14f2c097..024b349b252 100644 --- a/src/m365/spo/commands/file/file-version-restore.ts +++ b/src/m365/spo/commands/file/file-version-restore.ts @@ -17,7 +17,7 @@ interface Options extends GlobalOptions { label: string; fileUrl?: string; fileId?: string; - confirm?: boolean; + force?: boolean; } class SpoFileVersionRestoreCommand extends SpoCommand { @@ -44,7 +44,7 @@ class SpoFileVersionRestoreCommand extends SpoCommand { Object.assign(this.telemetryProperties, { fileUrl: args.options.fileUrl, fileId: args.options.fileId, - confirm: (!!args.options.confirm).toString() + force: (!!args.options.force).toString() }); }); } @@ -64,7 +64,7 @@ class SpoFileVersionRestoreCommand extends SpoCommand { option: '-i, --fileId [fileId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -95,7 +95,7 @@ class SpoFileVersionRestoreCommand extends SpoCommand { } try { - if (args.options.confirm) { + if (args.options.force) { await this.restoreVersion(args); } else { diff --git a/src/m365/spo/commands/folder/folder-get.ts b/src/m365/spo/commands/folder/folder-get.ts index 07c898daccc..462fe537b28 100644 --- a/src/m365/spo/commands/folder/folder-get.ts +++ b/src/m365/spo/commands/folder/folder-get.ts @@ -54,7 +54,7 @@ class SpoFolderGetCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --url [url]' + option: '--url [url]' }, { option: '-i, --id [id]' diff --git a/src/m365/spo/commands/folder/folder-list.ts b/src/m365/spo/commands/folder/folder-list.ts index d64a1e8f287..715ebaaaa7e 100644 --- a/src/m365/spo/commands/folder/folder-list.ts +++ b/src/m365/spo/commands/folder/folder-list.ts @@ -67,7 +67,7 @@ class SpoFolderListCommand extends SpoCommand { option: '-p, --parentFolderUrl ' }, { - option: '-f, --fields [fields]' + option: '--fields [fields]' }, { option: '--filter [filter]' diff --git a/src/m365/spo/commands/folder/folder-remove.spec.ts b/src/m365/spo/commands/folder/folder-remove.spec.ts index 37df0015dc3..094613f5f88 100644 --- a/src/m365/spo/commands/folder/folder-remove.spec.ts +++ b/src/m365/spo/commands/folder/folder-remove.spec.ts @@ -130,7 +130,7 @@ describe(commands.FOLDER_REMOVE, () => { verbose: true, webUrl: 'https://contoso.sharepoint.com', url: '/Shared Documents/Folder1', - confirm: true + force: true } }); const lastCall: any = request.lastCall.args[0]; diff --git a/src/m365/spo/commands/folder/folder-remove.ts b/src/m365/spo/commands/folder/folder-remove.ts index 9b0ecb92ff1..af6f4d5b7cb 100644 --- a/src/m365/spo/commands/folder/folder-remove.ts +++ b/src/m365/spo/commands/folder/folder-remove.ts @@ -16,7 +16,7 @@ interface Options extends GlobalOptions { webUrl: string; url: string; recycle?: boolean; - confirm?: boolean; + force?: boolean; } class SpoFolderRemoveCommand extends SpoCommand { @@ -40,7 +40,7 @@ class SpoFolderRemoveCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { recycle: (!(!args.options.recycle)).toString(), - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -51,13 +51,13 @@ class SpoFolderRemoveCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --url ' + option: '--url ' }, { option: '--recycle' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -69,7 +69,7 @@ class SpoFolderRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeFolder(logger, args.options); } else { diff --git a/src/m365/spo/commands/folder/folder-rename.ts b/src/m365/spo/commands/folder/folder-rename.ts index 599c7f6273f..349b86ed05a 100644 --- a/src/m365/spo/commands/folder/folder-rename.ts +++ b/src/m365/spo/commands/folder/folder-rename.ts @@ -41,7 +41,7 @@ class SpoFolderRenameCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --url ' + option: '--url ' }, { option: '-n, --name ' diff --git a/src/m365/spo/commands/folder/folder-retentionlabel-remove.spec.ts b/src/m365/spo/commands/folder/folder-retentionlabel-remove.spec.ts index ab9d0bbd874..8650924fda1 100644 --- a/src/m365/spo/commands/folder/folder-retentionlabel-remove.spec.ts +++ b/src/m365/spo/commands/folder/folder-retentionlabel-remove.spec.ts @@ -199,7 +199,7 @@ describe(commands.FOLDER_RETENTIONLABEL_REMOVE, () => { folderId: folderId, webUrl: webUrl, listItemId: 1, - confirm: true + force: true } })); }); @@ -228,7 +228,7 @@ describe(commands.FOLDER_RETENTIONLABEL_REMOVE, () => { debug: true, folderId: folderId, webUrl: webUrl, - confirm: true + force: true } })); }); @@ -242,7 +242,7 @@ describe(commands.FOLDER_RETENTIONLABEL_REMOVE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - confirm: true, + force: true, folderUrl: folderUrl, webUrl: webUrl } diff --git a/src/m365/spo/commands/folder/folder-retentionlabel-remove.ts b/src/m365/spo/commands/folder/folder-retentionlabel-remove.ts index e13d5bdd2e9..111ddc1885a 100644 --- a/src/m365/spo/commands/folder/folder-retentionlabel-remove.ts +++ b/src/m365/spo/commands/folder/folder-retentionlabel-remove.ts @@ -22,7 +22,7 @@ interface Options extends GlobalOptions { webUrl: string; folderUrl?: string; folderId?: string; - confirm?: boolean; + force?: boolean; } class SpoFolderRetentionLabelRemoveCommand extends SpoCommand { @@ -48,7 +48,7 @@ class SpoFolderRetentionLabelRemoveCommand extends SpoCommand { Object.assign(this.telemetryProperties, { folderUrl: typeof args.options.folderUrl !== 'undefined', folderId: typeof args.options.folderId !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -65,7 +65,7 @@ class SpoFolderRetentionLabelRemoveCommand extends SpoCommand { option: '-i, --folderId [folderId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -93,7 +93,7 @@ class SpoFolderRetentionLabelRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeFolderRetentionLabel(logger, args); } else { @@ -119,7 +119,7 @@ class SpoFolderRetentionLabelRemoveCommand extends SpoCommand { webUrl: args.options.webUrl, listId: folderProperties.ListItemAllFields.ParentList.Id, listItemId: folderProperties.ListItemAllFields.Id, - confirm: true, + force: true, output: 'json', debug: this.debug, verbose: this.verbose @@ -134,7 +134,7 @@ class SpoFolderRetentionLabelRemoveCommand extends SpoCommand { const options: SpoListRetentionLabelRemoveCommandOptions = { webUrl: args.options.webUrl, listUrl: folderProperties.ServerRelativeUrl, - confirm: true, + force: true, output: 'json', debug: this.debug, verbose: this.verbose diff --git a/src/m365/spo/commands/folder/folder-roleassignment-add.ts b/src/m365/spo/commands/folder/folder-roleassignment-add.ts index 297fdaa67ff..2ca91cf6cac 100644 --- a/src/m365/spo/commands/folder/folder-roleassignment-add.ts +++ b/src/m365/spo/commands/folder/folder-roleassignment-add.ts @@ -65,7 +65,7 @@ class SpoFolderRoleAssignmentAddCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --folderUrl ' + option: '--folderUrl ' }, { option: '--principalId [principalId]' diff --git a/src/m365/spo/commands/folder/folder-roleassignment-remove.spec.ts b/src/m365/spo/commands/folder/folder-roleassignment-remove.spec.ts index eae4da13bcf..dca0d76a90a 100644 --- a/src/m365/spo/commands/folder/folder-roleassignment-remove.spec.ts +++ b/src/m365/spo/commands/folder/folder-roleassignment-remove.spec.ts @@ -136,7 +136,7 @@ describe(commands.FOLDER_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folderUrl: '/Shared Documents/FolderPermission', principalId: 11, - confirm: true + force: true } }); }); @@ -166,7 +166,7 @@ describe(commands.FOLDER_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folderUrl: '/Shared Documents/FolderPermission', upn: 'someaccount@tenant.onmicrosoft.com', - confirm: true + force: true } }); }); @@ -195,7 +195,7 @@ describe(commands.FOLDER_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folderUrl: '/Shared Documents/FolderPermission', upn: 'someaccount@tenant.onmicrosoft.com', - confirm: true + force: true } } as any), new CommandError(error)); }); @@ -225,7 +225,7 @@ describe(commands.FOLDER_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folderUrl: '/Shared Documents/FolderPermission', groupName: 'someGroup', - confirm: true + force: true } }); }); @@ -254,7 +254,7 @@ describe(commands.FOLDER_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folderUrl: '/Shared Documents/FolderPermission', groupName: 'someGroup', - confirm: true + force: true } } as any), new CommandError(error)); }); diff --git a/src/m365/spo/commands/folder/folder-roleassignment-remove.ts b/src/m365/spo/commands/folder/folder-roleassignment-remove.ts index b81ea731789..96332ea2b75 100644 --- a/src/m365/spo/commands/folder/folder-roleassignment-remove.ts +++ b/src/m365/spo/commands/folder/folder-roleassignment-remove.ts @@ -23,7 +23,7 @@ interface Options extends GlobalOptions { principalId?: number; upn?: string; groupName?: string; - confirm?: boolean; + force?: boolean; } class SpoFolderRoleAssignmentRemoveCommand extends SpoCommand { @@ -49,7 +49,7 @@ class SpoFolderRoleAssignmentRemoveCommand extends SpoCommand { principalId: typeof args.options.principalId !== 'undefined', upn: typeof args.options.upn !== 'undefined', groupName: typeof args.options.groupName !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -60,7 +60,7 @@ class SpoFolderRoleAssignmentRemoveCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --folderUrl ' + option: '--folderUrl ' }, { option: '--principalId [principalId]' @@ -72,7 +72,7 @@ class SpoFolderRoleAssignmentRemoveCommand extends SpoCommand { option: '--groupName [groupName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -129,7 +129,7 @@ class SpoFolderRoleAssignmentRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeRoleAssignment(); } else { diff --git a/src/m365/spo/commands/folder/folder-roleinheritance-break.spec.ts b/src/m365/spo/commands/folder/folder-roleinheritance-break.spec.ts index 36836910909..7e617522573 100644 --- a/src/m365/spo/commands/folder/folder-roleinheritance-break.spec.ts +++ b/src/m365/spo/commands/folder/folder-roleinheritance-break.spec.ts @@ -75,12 +75,12 @@ describe(commands.FOLDER_ROLEINHERITANCE_BREAK, () => { }); it('fails validation if the webUrl option is not a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { webUrl: 'foo', folderUrl: folderUrl, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'foo', folderUrl: folderUrl, force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation if webUrl and folderUrl are valid', async () => { - const actual = await command.validate({ options: { webUrl: webUrl, folderUrl: folderUrl, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: webUrl, folderUrl: folderUrl, force: true } }, commandInfo); assert.strictEqual(actual, true); }); @@ -129,7 +129,7 @@ describe(commands.FOLDER_ROLEINHERITANCE_BREAK, () => { debug: true, webUrl: webUrl, folderUrl: folderUrl, - confirm: true + force: true } }); }); @@ -216,7 +216,7 @@ describe(commands.FOLDER_ROLEINHERITANCE_BREAK, () => { debug: true, webUrl: webUrl, folderUrl: folderUrl, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/spo/commands/folder/folder-roleinheritance-break.ts b/src/m365/spo/commands/folder/folder-roleinheritance-break.ts index f7fe143a9a0..e952cc2c68a 100644 --- a/src/m365/spo/commands/folder/folder-roleinheritance-break.ts +++ b/src/m365/spo/commands/folder/folder-roleinheritance-break.ts @@ -16,7 +16,7 @@ interface Options extends GlobalOptions { webUrl: string; folderUrl: string; clearExistingPermissions?: boolean; - confirm?: boolean; + force?: boolean; } class SpoFolderRoleInheritanceBreakCommand extends SpoCommand { @@ -40,7 +40,7 @@ class SpoFolderRoleInheritanceBreakCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { clearExistingPermissions: !!args.options.clearExistingPermissions, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -51,13 +51,13 @@ class SpoFolderRoleInheritanceBreakCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --folderUrl ' + option: '--folderUrl ' }, { option: '-c, --clearExistingPermissions' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -96,7 +96,7 @@ class SpoFolderRoleInheritanceBreakCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await breakFolderRoleInheritance(); } else { diff --git a/src/m365/spo/commands/folder/folder-roleinheritance-reset.spec.ts b/src/m365/spo/commands/folder/folder-roleinheritance-reset.spec.ts index 830fa84198a..e8c2f864fe9 100644 --- a/src/m365/spo/commands/folder/folder-roleinheritance-reset.spec.ts +++ b/src/m365/spo/commands/folder/folder-roleinheritance-reset.spec.ts @@ -73,12 +73,12 @@ describe(commands.FOLDER_ROLEINHERITANCE_RESET, () => { }); it('fails validation if the webUrl option is not a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { webUrl: 'foo', folderUrl: folderUrl, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: 'foo', folderUrl: folderUrl, force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation if webUrl and folderUrl are valid', async () => { - const actual = await command.validate({ options: { webUrl: webUrl, folderUrl: folderUrl, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { webUrl: webUrl, folderUrl: folderUrl, force: true } }, commandInfo); assert.strictEqual(actual, true); }); @@ -126,7 +126,7 @@ describe(commands.FOLDER_ROLEINHERITANCE_RESET, () => { verbose: true, webUrl: webUrl, folderUrl: folderUrl, - confirm: true + force: true } }); }); @@ -190,7 +190,7 @@ describe(commands.FOLDER_ROLEINHERITANCE_RESET, () => { debug: true, webUrl: webUrl, folderUrl: folderUrl, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/spo/commands/folder/folder-roleinheritance-reset.ts b/src/m365/spo/commands/folder/folder-roleinheritance-reset.ts index d4899177d0e..f24320e7172 100644 --- a/src/m365/spo/commands/folder/folder-roleinheritance-reset.ts +++ b/src/m365/spo/commands/folder/folder-roleinheritance-reset.ts @@ -15,7 +15,7 @@ interface CommandArgs { interface Options extends GlobalOptions { webUrl: string; folderUrl: string; - confirm?: boolean; + force?: boolean; } class SpoFolderRoleInheritanceResetCommand extends SpoCommand { @@ -38,7 +38,7 @@ class SpoFolderRoleInheritanceResetCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -49,10 +49,10 @@ class SpoFolderRoleInheritanceResetCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --folderUrl ' + option: '--folderUrl ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -91,7 +91,7 @@ class SpoFolderRoleInheritanceResetCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await resetFolderRoleInheritance(); } else { diff --git a/src/m365/spo/commands/group/group-member-remove.spec.ts b/src/m365/spo/commands/group/group-member-remove.spec.ts index 5e03fcb27fa..8560c2515c1 100644 --- a/src/m365/spo/commands/group/group-member-remove.spec.ts +++ b/src/m365/spo/commands/group/group-member-remove.spec.ts @@ -154,7 +154,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: "https://contoso.sharepoint.com/sites/SiteA", groupName: "Site A Visitors", aadGroupId: "5786b8e8-c495-4734-b345-756733960730", - confirm: true + force: true } }); assert(postStub.called); @@ -209,7 +209,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: "https://contoso.sharepoint.com/sites/SiteA", groupName: "Site A Visitors", aadGroupName: "Not existing group", - confirm: true + force: true } }), new CommandError('The Azure AD group Not existing group is not found in SharePoint group Site A Visitors')); }); @@ -227,7 +227,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: "https://contoso.sharepoint.com/sites/SiteA", groupId: 4, userName: "Alex.Wilber@contoso.com", - confirm: true + force: true } }); assert(postStub.called); @@ -385,7 +385,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: webUrl, groupId: groupId, userName: userName, - confirm: true + force: true } }); @@ -413,7 +413,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: webUrl, groupId: groupId, userName: userName, - confirm: false + force: false } }); @@ -440,7 +440,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: webUrl, groupId: groupId, userId: userId, - confirm: false + force: false } }); @@ -473,7 +473,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: webUrl, groupId: groupId, email: email, - confirm: false + force: false } }); @@ -495,7 +495,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: webUrl, groupName: groupName, userId: userId, - confirm: true + force: true } }); @@ -523,7 +523,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: webUrl, groupName: groupName, email: email, - confirm: true + force: true } }); @@ -543,7 +543,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: webUrl, groupId: groupId, userName: userName, - confirm: false + force: false } }); assert(postSpy.notCalled); @@ -565,7 +565,7 @@ describe(commands.GROUP_MEMBER_REMOVE, () => { webUrl: webUrl, groupId: groupId, userName: userName, - confirm: true + force: true } }), new CommandError('The user does not exist or is not unique.')); }); diff --git a/src/m365/spo/commands/group/group-member-remove.ts b/src/m365/spo/commands/group/group-member-remove.ts index 4f34b2eed46..4d9e0416fad 100644 --- a/src/m365/spo/commands/group/group-member-remove.ts +++ b/src/m365/spo/commands/group/group-member-remove.ts @@ -26,7 +26,7 @@ interface Options extends GlobalOptions { userId?: number; aadGroupId?: string; aadGroupName?: string; - confirm?: boolean; + force?: boolean; } class SpoGroupMemberRemoveCommand extends SpoCommand { @@ -57,7 +57,7 @@ class SpoGroupMemberRemoveCommand extends SpoCommand { userId: (!(!args.options.userId)).toString(), aadGroupId: (!(!args.options.groupId)).toString(), aadGroupName: (!(!args.options.groupName)).toString(), - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -89,7 +89,7 @@ class SpoGroupMemberRemoveCommand extends SpoCommand { option: '--aadGroupName [aadGroupName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -151,7 +151,7 @@ class SpoGroupMemberRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { if (this.debug) { logger.logToStderr('Confirmation bypassed by entering confirm option. Removing the user from SharePoint Group...'); } diff --git a/src/m365/spo/commands/group/group-remove.spec.ts b/src/m365/spo/commands/group/group-remove.spec.ts index a27d979c88e..7ff2e7b00e2 100755 --- a/src/m365/spo/commands/group/group-remove.spec.ts +++ b/src/m365/spo/commands/group/group-remove.spec.ts @@ -80,7 +80,7 @@ describe(commands.GROUP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/mysite', id: 7, debug: true, confirm: true } }); + await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/mysite', id: 7, debug: true, force: true } }); assert(requestPostSpy.called); }); @@ -101,7 +101,7 @@ describe(commands.GROUP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/mysite', name: 'Team Site Owners', debug: true, confirm: true } }); + await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/mysite', name: 'Team Site Owners', debug: true, force: true } }); assert(requestPostSpy.called); }); @@ -150,7 +150,7 @@ describe(commands.GROUP_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/mysite', id: 7, debug: true, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/mysite', id: 7, debug: true, force: true } } as any), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/group/group-remove.ts b/src/m365/spo/commands/group/group-remove.ts index 7dfaf8575b9..11b0ffb86a8 100755 --- a/src/m365/spo/commands/group/group-remove.ts +++ b/src/m365/spo/commands/group/group-remove.ts @@ -14,7 +14,7 @@ interface Options extends GlobalOptions { webUrl: string; id?: number; name?: string; - confirm?: boolean; + force?: boolean; } class SpoGroupRemoveCommand extends SpoCommand { @@ -40,7 +40,7 @@ class SpoGroupRemoveCommand extends SpoCommand { Object.assign(this.telemetryProperties, { id: (!(!args.options.id)).toString(), name: (!(!args.options.name)).toString(), - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -57,7 +57,7 @@ class SpoGroupRemoveCommand extends SpoCommand { option: '--name [name]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -125,7 +125,7 @@ class SpoGroupRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeGroup(); } else { diff --git a/src/m365/spo/commands/homesite/homesite-remove.spec.ts b/src/m365/spo/commands/homesite/homesite-remove.spec.ts index 4c0e6cb273a..769b5ef114b 100644 --- a/src/m365/spo/commands/homesite/homesite-remove.spec.ts +++ b/src/m365/spo/commands/homesite/homesite-remove.spec.ts @@ -147,7 +147,7 @@ describe(commands.HOMESITE_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { confirm: true } }); + await command.action(logger, { options: { force: true } }); assert(homeSiteRemoveCallIssued); }); @@ -168,7 +168,7 @@ describe(commands.HOMESITE_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { debug: true, force: true } } as any), new CommandError(`The requested operation is part of an experimental feature that is not supported in the current environment.`)); }); @@ -188,7 +188,7 @@ describe(commands.HOMESITE_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - confirm: true + force: true } } as any), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/homesite/homesite-remove.ts b/src/m365/spo/commands/homesite/homesite-remove.ts index f52741c8441..86364bd22de 100644 --- a/src/m365/spo/commands/homesite/homesite-remove.ts +++ b/src/m365/spo/commands/homesite/homesite-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; } class SpoHomeSiteRemoveCommand extends SpoCommand { @@ -34,7 +34,7 @@ class SpoHomeSiteRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: args.options.confirm || false + force: args.options.force || false }); }); } @@ -42,7 +42,7 @@ class SpoHomeSiteRemoveCommand extends SpoCommand { #initOptions(): void { this.options.unshift( { - option: '--confirm' + option: '-f, --force' } ); } @@ -79,7 +79,7 @@ class SpoHomeSiteRemoveCommand extends SpoCommand { }; - if (args.options.confirm) { + if (args.options.force) { await removeHomeSite(); } else { diff --git a/src/m365/spo/commands/hubsite/hubsite-data-get.ts b/src/m365/spo/commands/hubsite/hubsite-data-get.ts index b4903008887..d43e7c69d00 100644 --- a/src/m365/spo/commands/hubsite/hubsite-data-get.ts +++ b/src/m365/spo/commands/hubsite/hubsite-data-get.ts @@ -45,7 +45,7 @@ class SpoHubSiteDataGetCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '-f, --forceRefresh' + option: '--forceRefresh' } ); } diff --git a/src/m365/spo/commands/hubsite/hubsite-disconnect.spec.ts b/src/m365/spo/commands/hubsite/hubsite-disconnect.spec.ts index 65edd6c48c6..6b54313e635 100644 --- a/src/m365/spo/commands/hubsite/hubsite-disconnect.spec.ts +++ b/src/m365/spo/commands/hubsite/hubsite-disconnect.spec.ts @@ -161,7 +161,7 @@ describe(commands.HUBSITE_DISCONNECT, () => { options: { id: id, verbose: true, - confirm: true + force: true } }); @@ -185,7 +185,7 @@ describe(commands.HUBSITE_DISCONNECT, () => { options: { title: title, verbose: true, - confirm: true + force: true } }); @@ -209,7 +209,7 @@ describe(commands.HUBSITE_DISCONNECT, () => { options: { url: url, verbose: true, - confirm: true + force: true } }); @@ -266,7 +266,7 @@ describe(commands.HUBSITE_DISCONNECT, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(`Multiple hub sites with name '${title}' found: ${response.value.map(s => s.ID).join(',')}.`)); }); @@ -288,7 +288,7 @@ describe(commands.HUBSITE_DISCONNECT, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(`The specified hub site '${title}' does not exist.`)); }); @@ -310,7 +310,7 @@ describe(commands.HUBSITE_DISCONNECT, () => { await assert.rejects(command.action(logger, { options: { url: url, - confirm: true + force: true } }), new CommandError(`The specified hub site '${url}' does not exist.`)); }); @@ -331,7 +331,7 @@ describe(commands.HUBSITE_DISCONNECT, () => { await assert.rejects(command.action(logger, { options: { id: id, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/spo/commands/hubsite/hubsite-disconnect.ts b/src/m365/spo/commands/hubsite/hubsite-disconnect.ts index 1ee9975143d..bb0e644ef05 100644 --- a/src/m365/spo/commands/hubsite/hubsite-disconnect.ts +++ b/src/m365/spo/commands/hubsite/hubsite-disconnect.ts @@ -16,7 +16,7 @@ interface Options extends GlobalOptions { id?: string; title?: string; url?: string; - confirm?: boolean; + force?: boolean; } class SpoHubSiteDisconnectCommand extends SpoCommand { @@ -59,7 +59,7 @@ class SpoHubSiteDisconnectCommand extends SpoCommand { option: '-u, --url [url]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -119,7 +119,7 @@ class SpoHubSiteDisconnectCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await disconnectHubSite(); } else { diff --git a/src/m365/spo/commands/hubsite/hubsite-rights-revoke.spec.ts b/src/m365/spo/commands/hubsite/hubsite-rights-revoke.spec.ts index 547280e72a8..d62b23f83ec 100644 --- a/src/m365/spo/commands/hubsite/hubsite-rights-revoke.spec.ts +++ b/src/m365/spo/commands/hubsite/hubsite-rights-revoke.spec.ts @@ -98,7 +98,7 @@ describe(commands.HUBSITE_RIGHTS_REVOKE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin', confirm: true } }); + await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -118,7 +118,7 @@ describe(commands.HUBSITE_RIGHTS_REVOKE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin', confirm: true } }); + await command.action(logger, { options: { debug: true, hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin', force: true } }); assert(loggerLogToStderrSpy.called); }); @@ -171,7 +171,7 @@ describe(commands.HUBSITE_RIGHTS_REVOKE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales>', principals: 'admin>', confirm: true } }); + await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales>', principals: 'admin>', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -191,7 +191,7 @@ describe(commands.HUBSITE_RIGHTS_REVOKE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin,user', confirm: true } }); + await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin,user', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -211,7 +211,7 @@ describe(commands.HUBSITE_RIGHTS_REVOKE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin@contoso.onmicrosoft.com,user@contoso.onmicrosoft.com', confirm: true } }); + await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin@contoso.onmicrosoft.com,user@contoso.onmicrosoft.com', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -231,7 +231,7 @@ describe(commands.HUBSITE_RIGHTS_REVOKE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin, user', confirm: true } }); + await command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin, user', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -250,7 +250,7 @@ describe(commands.HUBSITE_RIGHTS_REVOKE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { hubSiteUrl: 'https://contoso.sharepoint.com/sites/Sales', principals: 'admin', force: true } } as any), new CommandError('An error has occurred.')); }); diff --git a/src/m365/spo/commands/hubsite/hubsite-rights-revoke.ts b/src/m365/spo/commands/hubsite/hubsite-rights-revoke.ts index 69081f1955e..9ec629dd339 100644 --- a/src/m365/spo/commands/hubsite/hubsite-rights-revoke.ts +++ b/src/m365/spo/commands/hubsite/hubsite-rights-revoke.ts @@ -16,7 +16,7 @@ interface CommandArgs { interface Options extends GlobalOptions { hubSiteUrl: string; principals: string; - confirm?: boolean; + force?: boolean; } class SpoHubSiteRightsRevokeCommand extends SpoCommand { @@ -39,7 +39,7 @@ class SpoHubSiteRightsRevokeCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -53,7 +53,7 @@ class SpoHubSiteRightsRevokeCommand extends SpoCommand { option: '-p, --principals ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -100,7 +100,7 @@ class SpoHubSiteRightsRevokeCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await revokeRights(); } else { diff --git a/src/m365/spo/commands/hubsite/hubsite-unregister.spec.ts b/src/m365/spo/commands/hubsite/hubsite-unregister.spec.ts index 07f99647b71..916f751c4c1 100644 --- a/src/m365/spo/commands/hubsite/hubsite-unregister.spec.ts +++ b/src/m365/spo/commands/hubsite/hubsite-unregister.spec.ts @@ -93,7 +93,7 @@ describe(commands.HUBSITE_UNREGISTER, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/sales', confirm: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/sales', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -155,7 +155,7 @@ describe(commands.HUBSITE_UNREGISTER, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/sales', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/sales', force: true } } as any), new CommandError("hubSiteId")); }); diff --git a/src/m365/spo/commands/hubsite/hubsite-unregister.ts b/src/m365/spo/commands/hubsite/hubsite-unregister.ts index 189db0d3fea..69a435d6128 100644 --- a/src/m365/spo/commands/hubsite/hubsite-unregister.ts +++ b/src/m365/spo/commands/hubsite/hubsite-unregister.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { url: string; - confirm?: boolean; + force?: boolean; } class SpoHubSiteUnregisterCommand extends SpoCommand { @@ -36,7 +36,7 @@ class SpoHubSiteUnregisterCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: args.options.confirm || false + force: args.options.force || false }); }); } @@ -47,7 +47,7 @@ class SpoHubSiteUnregisterCommand extends SpoCommand { option: '-u, --url ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -83,7 +83,7 @@ class SpoHubSiteUnregisterCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await unregisterHubSite(); } else { diff --git a/src/m365/spo/commands/knowledgehub/knowledgehub-remove.spec.ts b/src/m365/spo/commands/knowledgehub/knowledgehub-remove.spec.ts index b67afcfe48b..d63ce79b423 100644 --- a/src/m365/spo/commands/knowledgehub/knowledgehub-remove.spec.ts +++ b/src/m365/spo/commands/knowledgehub/knowledgehub-remove.spec.ts @@ -92,7 +92,7 @@ describe(commands.KNOWLEDGEHUB_REMOVE, () => { }); it('removes Knowledge Hub settings from tenant without prompting with confirmation argument', async () => { - await command.action(logger, { options: { confirm: true } }); + await command.action(logger, { options: { force: true } }); let deleteRequestIssued = false; requests.forEach(r => { if (r.url.indexOf('/_vti_bin/client.svc/ProcessQuery') > -1 && @@ -106,7 +106,7 @@ describe(commands.KNOWLEDGEHUB_REMOVE, () => { }); it('removes Knowledge Hub settings from tenant without prompting with confirmation argument (debug)', async () => { - await command.action(logger, { options: { debug: true, confirm: true } }); + await command.action(logger, { options: { debug: true, force: true } }); let deleteRequestIssued = false; requests.forEach(r => { if (r.url.indexOf('/_vti_bin/client.svc/ProcessQuery') > -1 && @@ -175,6 +175,6 @@ describe(commands.KNOWLEDGEHUB_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { debug: true, confirm: true } } as any), new CommandError('An error has occurred')); + await assert.rejects(command.action(logger, { options: { debug: true, force: true } } as any), new CommandError('An error has occurred')); }); }); diff --git a/src/m365/spo/commands/knowledgehub/knowledgehub-remove.ts b/src/m365/spo/commands/knowledgehub/knowledgehub-remove.ts index f39c45b57cf..369b73d8166 100644 --- a/src/m365/spo/commands/knowledgehub/knowledgehub-remove.ts +++ b/src/m365/spo/commands/knowledgehub/knowledgehub-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; } class SpoKnowledgehubRemoveCommand extends SpoCommand { @@ -34,7 +34,7 @@ class SpoKnowledgehubRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -42,7 +42,7 @@ class SpoKnowledgehubRemoveCommand extends SpoCommand { #initOptions(): void { this.options.unshift( { - option: '--confirm' + option: '-f, --force' } ); } @@ -80,7 +80,7 @@ class SpoKnowledgehubRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { if (this.debug) { logger.logToStderr('Confirmation bypassed by entering confirm option. Removing Knowledge Hub Site setting...'); } diff --git a/src/m365/spo/commands/list/list-contenttype-remove.spec.ts b/src/m365/spo/commands/list/list-contenttype-remove.spec.ts index 9fcd7fb7337..57b953aa440 100644 --- a/src/m365/spo/commands/list/list-contenttype-remove.spec.ts +++ b/src/m365/spo/commands/list/list-contenttype-remove.spec.ts @@ -309,7 +309,7 @@ describe(commands.LIST_CONTENTTYPE_REMOVE, () => { listTitle: listTitle, webUrl: webUrl, id: contentTypeId, - confirm: true + force: true } }), new CommandError(err)); }); @@ -328,7 +328,7 @@ describe(commands.LIST_CONTENTTYPE_REMOVE, () => { listTitle: listTitle, webUrl: webUrl, id: contentTypeId, - confirm: true + force: true } }); assert(postStub.called); @@ -349,7 +349,7 @@ describe(commands.LIST_CONTENTTYPE_REMOVE, () => { listId: listId, webUrl: webUrl, id: contentTypeId, - confirm: true + force: true } }); assert(postStub.called); diff --git a/src/m365/spo/commands/list/list-contenttype-remove.ts b/src/m365/spo/commands/list/list-contenttype-remove.ts index 100f23ab589..f0cab76338b 100644 --- a/src/m365/spo/commands/list/list-contenttype-remove.ts +++ b/src/m365/spo/commands/list/list-contenttype-remove.ts @@ -18,7 +18,7 @@ interface Options extends GlobalOptions { listTitle?: string; listUrl?: string; id: string; - confirm?: boolean; + force?: boolean; } class SpoListContentTypeRemoveCommand extends SpoCommand { @@ -46,7 +46,7 @@ class SpoListContentTypeRemoveCommand extends SpoCommand { listId: typeof args.options.listId !== 'undefined', listTitle: typeof args.options.listTitle !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -69,7 +69,7 @@ class SpoListContentTypeRemoveCommand extends SpoCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -139,7 +139,7 @@ class SpoListContentTypeRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeContentTypeFromList(); } else { diff --git a/src/m365/spo/commands/list/list-list.ts b/src/m365/spo/commands/list/list-list.ts index beca8351754..c95c4d87ef2 100644 --- a/src/m365/spo/commands/list/list-list.ts +++ b/src/m365/spo/commands/list/list-list.ts @@ -51,7 +51,7 @@ class SpoListListCommand extends SpoCommand { option: '-p, --properties [properties]' }, { - option: '-f, --filter [filter]' + option: '--filter [filter]' } ); } diff --git a/src/m365/spo/commands/list/list-remove.spec.ts b/src/m365/spo/commands/list/list-remove.spec.ts index 759dab9e5f5..44225c465bb 100644 --- a/src/m365/spo/commands/list/list-remove.spec.ts +++ b/src/m365/spo/commands/list/list-remove.spec.ts @@ -146,7 +146,7 @@ describe(commands.LIST_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', confirm: true } }); + await command.action(logger, { options: { id: 'b2307a39-e878-458b-bc90-03bc578531d6', webUrl: 'https://contoso.sharepoint.com', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/lists(guid'`) > -1 && @@ -184,7 +184,7 @@ describe(commands.LIST_REMOVE, () => { debug: true, title: actionTitle, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/list/list-remove.ts b/src/m365/spo/commands/list/list-remove.ts index e0a7a7ec22b..314b3750f90 100644 --- a/src/m365/spo/commands/list/list-remove.ts +++ b/src/m365/spo/commands/list/list-remove.ts @@ -15,7 +15,7 @@ interface Options extends GlobalOptions { webUrl: string; id?: string; title?: string; - confirm?: boolean; + force?: boolean; } class SpoListRemoveCommand extends SpoCommand { @@ -41,7 +41,7 @@ class SpoListRemoveCommand extends SpoCommand { Object.assign(this.telemetryProperties, { id: (!(!args.options.id)).toString(), title: (!(!args.options.title)).toString(), - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -58,7 +58,7 @@ class SpoListRemoveCommand extends SpoCommand { option: '-t, --title [title]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -119,7 +119,7 @@ class SpoListRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeList(); } else { diff --git a/src/m365/spo/commands/list/list-retentionlabel-remove.spec.ts b/src/m365/spo/commands/list/list-retentionlabel-remove.spec.ts index b21df52ace8..5966918f067 100644 --- a/src/m365/spo/commands/list/list-retentionlabel-remove.spec.ts +++ b/src/m365/spo/commands/list/list-retentionlabel-remove.spec.ts @@ -166,7 +166,7 @@ describe(commands.LIST_RETENTIONLABEL_REMOVE, () => { options: { webUrl: 'https://contoso.sharepoint.com/sites/team1', listTitle: 'MyLibrary', - confirm: true + force: true } } as any), new CommandError("Can not find compliance tag with value: abc. SiteSubscriptionId: ea1787c6-7ce2-4e71-be47-5e0deb30f9e4")); }); @@ -195,7 +195,7 @@ describe(commands.LIST_RETENTIONLABEL_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/team1', listTitle: 'MyLibrary', - confirm: true + force: true } } as any), new CommandError(error.error['odata.error'].message.value)); }); @@ -222,7 +222,7 @@ describe(commands.LIST_RETENTIONLABEL_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/team1', listTitle: 'MyLibrary', - confirm: true + force: true } })); }); @@ -249,7 +249,7 @@ describe(commands.LIST_RETENTIONLABEL_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/team1', listId: 'faaa6af2-0157-4e9a-a352-6165195923c8', - confirm: true + force: true } })); }); @@ -268,7 +268,7 @@ describe(commands.LIST_RETENTIONLABEL_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/team1', listUrl: '/sites/team1/MyLibrary', - confirm: true + force: true } })); }); diff --git a/src/m365/spo/commands/list/list-retentionlabel-remove.ts b/src/m365/spo/commands/list/list-retentionlabel-remove.ts index 2024c28e6b9..8b955e66daa 100644 --- a/src/m365/spo/commands/list/list-retentionlabel-remove.ts +++ b/src/m365/spo/commands/list/list-retentionlabel-remove.ts @@ -18,7 +18,7 @@ export interface Options extends GlobalOptions { listId?: string; listTitle?: string; listUrl?: string; - confirm: boolean; + force: boolean; } class SpoListRetentionLabelRemoveCommand extends SpoCommand { @@ -45,7 +45,7 @@ class SpoListRetentionLabelRemoveCommand extends SpoCommand { listId: typeof args.options.listId !== 'undefined', listTitle: typeof args.options.listTitle !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -65,7 +65,7 @@ class SpoListRetentionLabelRemoveCommand extends SpoCommand { option: '-l, --listUrl [listUrl]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -87,7 +87,7 @@ class SpoListRetentionLabelRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeListRetentionLabel(logger, args); } else { diff --git a/src/m365/spo/commands/list/list-roleassignment-remove.spec.ts b/src/m365/spo/commands/list/list-roleassignment-remove.spec.ts index a21d4f21169..fd600e69413 100644 --- a/src/m365/spo/commands/list/list-roleassignment-remove.spec.ts +++ b/src/m365/spo/commands/list/list-roleassignment-remove.spec.ts @@ -117,7 +117,7 @@ describe(commands.LIST_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', listTitle: 'test', principalId: 11, - confirm: true + force: true } }); }); @@ -137,7 +137,7 @@ describe(commands.LIST_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', principalId: 11, - confirm: true + force: true } }); }); @@ -157,7 +157,7 @@ describe(commands.LIST_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', listUrl: 'sites/documents', principalId: 11, - confirm: true + force: true } }); }); @@ -187,7 +187,7 @@ describe(commands.LIST_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', upn: 'someaccount@tenant.onmicrosoft.com', - confirm: true + force: true } }); }); @@ -216,7 +216,7 @@ describe(commands.LIST_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', upn: 'someaccount@tenant.onmicrosoft.com', - confirm: true + force: true } } as any), new CommandError(error)); }); @@ -246,7 +246,7 @@ describe(commands.LIST_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', groupName: 'someGroup', - confirm: true + force: true } }); }); @@ -275,7 +275,7 @@ describe(commands.LIST_ROLEASSIGNMENT_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', groupName: 'someGroup', - confirm: true + force: true } } as any), new CommandError(error)); }); diff --git a/src/m365/spo/commands/list/list-roleassignment-remove.ts b/src/m365/spo/commands/list/list-roleassignment-remove.ts index 4a5157920ca..c73e2a04b27 100644 --- a/src/m365/spo/commands/list/list-roleassignment-remove.ts +++ b/src/m365/spo/commands/list/list-roleassignment-remove.ts @@ -25,7 +25,7 @@ interface Options extends GlobalOptions { principalId?: number; upn?: string; groupName?: string; - confirm?: boolean; + force?: boolean; } class SpoListRoleAssignmentRemoveCommand extends SpoCommand { @@ -55,7 +55,7 @@ class SpoListRoleAssignmentRemoveCommand extends SpoCommand { principalId: typeof args.options.principalId !== 'undefined', upn: typeof args.options.upn !== 'undefined', groupName: typeof args.options.groupName !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -84,7 +84,7 @@ class SpoListRoleAssignmentRemoveCommand extends SpoCommand { option: '--groupName [groupName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -153,7 +153,7 @@ class SpoListRoleAssignmentRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeRoleAssignment(); } else { diff --git a/src/m365/spo/commands/list/list-roleinheritance-break.spec.ts b/src/m365/spo/commands/list/list-roleinheritance-break.spec.ts index 51b74dece35..4485c76b499 100644 --- a/src/m365/spo/commands/list/list-roleinheritance-break.spec.ts +++ b/src/m365/spo/commands/list/list-roleinheritance-break.spec.ts @@ -125,7 +125,7 @@ describe(commands.LIST_ROLEINHERITANCE_BREAK, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', listTitle: 'test', - confirm: true + force: true } }); }); @@ -145,7 +145,7 @@ describe(commands.LIST_ROLEINHERITANCE_BREAK, () => { webUrl: 'https://contoso.sharepoint.com', listTitle: 'test', clearExistingPermissions: true, - confirm: true + force: true } }); }); @@ -165,7 +165,7 @@ describe(commands.LIST_ROLEINHERITANCE_BREAK, () => { webUrl: 'https://contoso.sharepoint.com', listUrl: 'sites/documents', clearExistingPermissions: true, - confirm: true + force: true } }); }); @@ -185,7 +185,7 @@ describe(commands.LIST_ROLEINHERITANCE_BREAK, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', listId: '202b8199-b9de-43fd-9737-7f213f51c991', - confirm: true + force: true } }); }); @@ -205,7 +205,7 @@ describe(commands.LIST_ROLEINHERITANCE_BREAK, () => { webUrl: 'https://contoso.sharepoint.com', listId: '202b8199-b9de-43fd-9737-7f213f51c991', clearExistingPermissions: true, - confirm: true + force: true } }); }); @@ -234,7 +234,7 @@ describe(commands.LIST_ROLEINHERITANCE_BREAK, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', listTitle: 'test', - confirm: true + force: true } }), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/list/list-roleinheritance-break.ts b/src/m365/spo/commands/list/list-roleinheritance-break.ts index 82b3ad7cb51..6f012c57fab 100644 --- a/src/m365/spo/commands/list/list-roleinheritance-break.ts +++ b/src/m365/spo/commands/list/list-roleinheritance-break.ts @@ -18,7 +18,7 @@ interface Options extends GlobalOptions { listTitle?: string; listUrl?: string; clearExistingPermissions?: boolean; - confirm?: boolean; + force?: boolean; } class SpoListRoleInheritanceBreakCommand extends SpoCommand { @@ -46,7 +46,7 @@ class SpoListRoleInheritanceBreakCommand extends SpoCommand { listTitle: typeof args.options.listTitle !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', clearExistingPermissions: args.options.clearExistingPermissions === true, - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -69,7 +69,7 @@ class SpoListRoleInheritanceBreakCommand extends SpoCommand { option: '-c, --clearExistingPermissions' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -136,7 +136,7 @@ class SpoListRoleInheritanceBreakCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await breakListRoleInheritance(); } else { diff --git a/src/m365/spo/commands/list/list-roleinheritance-reset.spec.ts b/src/m365/spo/commands/list/list-roleinheritance-reset.spec.ts index 6d37d7b93f6..cefe0c18768 100644 --- a/src/m365/spo/commands/list/list-roleinheritance-reset.spec.ts +++ b/src/m365/spo/commands/list/list-roleinheritance-reset.spec.ts @@ -125,7 +125,7 @@ describe(commands.LIST_ROLEINHERITANCE_RESET, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', listTitle: 'test', - confirm: true + force: true } }); }); @@ -144,7 +144,7 @@ describe(commands.LIST_ROLEINHERITANCE_RESET, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', listUrl: 'sites/documents', - confirm: true + force: true } }); }); @@ -163,7 +163,7 @@ describe(commands.LIST_ROLEINHERITANCE_RESET, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', listId: '202b8199-b9de-43fd-9737-7f213f51c991', - confirm: true + force: true } }); }); @@ -183,7 +183,7 @@ describe(commands.LIST_ROLEINHERITANCE_RESET, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', listTitle: 'test', - confirm: true + force: true } }), new CommandError(err)); }); diff --git a/src/m365/spo/commands/list/list-roleinheritance-reset.ts b/src/m365/spo/commands/list/list-roleinheritance-reset.ts index 15144ada872..c654761370a 100644 --- a/src/m365/spo/commands/list/list-roleinheritance-reset.ts +++ b/src/m365/spo/commands/list/list-roleinheritance-reset.ts @@ -17,7 +17,7 @@ interface Options extends GlobalOptions { listId?: string; listTitle?: string; listUrl?: string; - confirm?: boolean; + force?: boolean; } class SpoListRoleInheritanceResetCommand extends SpoCommand { @@ -44,7 +44,7 @@ class SpoListRoleInheritanceResetCommand extends SpoCommand { listId: typeof args.options.listId !== 'undefined', listTitle: typeof args.options.listTitle !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -64,7 +64,7 @@ class SpoListRoleInheritanceResetCommand extends SpoCommand { option: '--listUrl [listUrl]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -126,7 +126,7 @@ class SpoListRoleInheritanceResetCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await resetListRoleInheritance(); } else { diff --git a/src/m365/spo/commands/list/list-view-field-add.spec.ts b/src/m365/spo/commands/list/list-view-field-add.spec.ts index 570ba21ad9f..d198272bb0c 100644 --- a/src/m365/spo/commands/list/list-view-field-add.spec.ts +++ b/src/m365/spo/commands/list/list-view-field-add.spec.ts @@ -476,7 +476,7 @@ describe(commands.LIST_VIEW_FIELD_ADD, () => { id: '330f29c5-5c4c-465f-9f4b-7903020ae1ce', webUrl: 'https://contoso.sharepoint.com', listTitle: 'Documents', - confirm: true + force: true } } as any), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/list/list-view-field-remove.spec.ts b/src/m365/spo/commands/list/list-view-field-remove.spec.ts index 6dbdafb6c37..e7a1ef8a958 100644 --- a/src/m365/spo/commands/list/list-view-field-remove.spec.ts +++ b/src/m365/spo/commands/list/list-view-field-remove.spec.ts @@ -236,7 +236,7 @@ describe(commands.LIST_VIEW_FIELD_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/ninja', listTitle: 'Documents', viewTitle: 'MyView', title: 'Created By', confirm: true } }); + await command.action(logger, { options: { verbose: true, webUrl: 'https://contoso.sharepoint.com/sites/ninja', listTitle: 'Documents', viewTitle: 'MyView', title: 'Created By', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/lists/GetByTitle('Documents')/views/GetByTitle('MyView')/viewfields/removeviewfield('`) > -1 && @@ -491,7 +491,7 @@ describe(commands.LIST_VIEW_FIELD_REMOVE, () => { listUrl: '/sites/ninja/Shared Documents', viewId: 'cc27a922-8224-4296-90a5-ebbc54da2e81', id: '330f29c5-5c4c-465f-9f4b-7903020ae1ce', - confirm: true + force: true } } as any), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/list/list-view-field-remove.ts b/src/m365/spo/commands/list/list-view-field-remove.ts index 625e94801e6..43223fea0e0 100644 --- a/src/m365/spo/commands/list/list-view-field-remove.ts +++ b/src/m365/spo/commands/list/list-view-field-remove.ts @@ -21,7 +21,7 @@ interface Options extends GlobalOptions { viewTitle?: string; id?: string; title?: string; - confirm?: boolean; + force?: boolean; } class SpoListViewFieldRemoveCommand extends SpoCommand { @@ -52,7 +52,7 @@ class SpoListViewFieldRemoveCommand extends SpoCommand { viewTitle: typeof args.options.viewTitle !== 'undefined', id: typeof args.options.id !== 'undefined', title: typeof args.options.title !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -84,7 +84,7 @@ class SpoListViewFieldRemoveCommand extends SpoCommand { option: '--title [title]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -171,7 +171,7 @@ class SpoListViewFieldRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeFieldFromView(); } else { diff --git a/src/m365/spo/commands/list/list-view-remove.spec.ts b/src/m365/spo/commands/list/list-view-remove.spec.ts index 274fea853a3..33dc198170e 100644 --- a/src/m365/spo/commands/list/list-view-remove.spec.ts +++ b/src/m365/spo/commands/list/list-view-remove.spec.ts @@ -207,7 +207,7 @@ describe(commands.LIST_VIEW_REMOVE, () => { webUrl: webUrl, listId: listId, id: viewId, - confirm: true + force: true } }); }); @@ -229,7 +229,7 @@ describe(commands.LIST_VIEW_REMOVE, () => { webUrl: webUrl, listTitle: listTitle, id: viewId, - confirm: true + force: true } }); }); @@ -252,7 +252,7 @@ describe(commands.LIST_VIEW_REMOVE, () => { webUrl: webUrl, listUrl: listUrl, title: viewTitle, - confirm: true + force: true } }); }); @@ -275,7 +275,7 @@ describe(commands.LIST_VIEW_REMOVE, () => { webUrl: webUrl, listId: listId, title: viewTitle, - confirm: true + force: true } }); }); @@ -297,7 +297,7 @@ describe(commands.LIST_VIEW_REMOVE, () => { webUrl: webUrl, listTitle: listTitle, title: viewTitle, - confirm: true + force: true } }); }); @@ -322,7 +322,7 @@ describe(commands.LIST_VIEW_REMOVE, () => { webUrl: webUrl, listTitle: listTitle, title: viewTitle, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/spo/commands/list/list-view-remove.ts b/src/m365/spo/commands/list/list-view-remove.ts index 6ced5e31c0f..7aec553080b 100644 --- a/src/m365/spo/commands/list/list-view-remove.ts +++ b/src/m365/spo/commands/list/list-view-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; listId?: string; listTitle?: string; listUrl?: string; @@ -48,7 +48,7 @@ class SpoListViewRemoveCommand extends SpoCommand { listUrl: typeof args.options.listUrl !== 'undefined', id: typeof args.options.id !== 'undefined', title: typeof args.options.title !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -74,7 +74,7 @@ class SpoListViewRemoveCommand extends SpoCommand { option: '--title [title]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -152,7 +152,7 @@ class SpoListViewRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeViewFromList(); } else { diff --git a/src/m365/spo/commands/list/list-webhook-remove.spec.ts b/src/m365/spo/commands/list/list-webhook-remove.spec.ts index 7860f285fc0..d2921ae7173 100644 --- a/src/m365/spo/commands/list/list-webhook-remove.spec.ts +++ b/src/m365/spo/commands/list/list-webhook-remove.spec.ts @@ -251,7 +251,7 @@ describe(commands.LIST_WEBHOOK_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/ninja', listId: 'dfddade1-4729-428d-881e-7fedf3cae50d', id: 'cc27a922-8224-4296-90a5-ebbc54da2e81', confirm: true } }); + await command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/ninja', listId: 'dfddade1-4729-428d-881e-7fedf3cae50d', id: 'cc27a922-8224-4296-90a5-ebbc54da2e81', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url === `https://contoso.sharepoint.com/sites/ninja/_api/web/lists(guid'dfddade1-4729-428d-881e-7fedf3cae50d')/Subscriptions('cc27a922-8224-4296-90a5-ebbc54da2e81')` && @@ -278,7 +278,7 @@ describe(commands.LIST_WEBHOOK_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/ninja', listUrl: '/sites/ninja/lists/Documents', id: 'cc27a922-8224-4296-90a5-ebbc54da2e81', confirm: true } }); + await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/ninja', listUrl: '/sites/ninja/lists/Documents', id: 'cc27a922-8224-4296-90a5-ebbc54da2e81', force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url === `https://contoso.sharepoint.com/sites/ninja/_api/web/GetList('${formatting.encodeQueryParameter('/sites/ninja/lists/Documents')}')/Subscriptions('cc27a922-8224-4296-90a5-ebbc54da2e81')` && @@ -368,7 +368,7 @@ describe(commands.LIST_WEBHOOK_REMOVE, () => { id: '0cd891ef-afce-4e55-b836-fce03286cccf', webUrl: 'https://contoso.sharepoint.com', listTitle: 'Documents', - confirm: true + force: true } } as any), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/list/list-webhook-remove.ts b/src/m365/spo/commands/list/list-webhook-remove.ts index 43b6b8fcacb..e8b6c92c36d 100644 --- a/src/m365/spo/commands/list/list-webhook-remove.ts +++ b/src/m365/spo/commands/list/list-webhook-remove.ts @@ -18,7 +18,7 @@ interface Options extends GlobalOptions { listTitle?: string; listUrl?: string; id: string; - confirm?: boolean; + force?: boolean; } class SpoListWebhookRemoveCommand extends SpoCommand { @@ -46,7 +46,7 @@ class SpoListWebhookRemoveCommand extends SpoCommand { listTitle: typeof args.options.listTitle !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', id: typeof args.options.id !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -69,7 +69,7 @@ class SpoListWebhookRemoveCommand extends SpoCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -139,7 +139,7 @@ class SpoListWebhookRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeWebhook(); } else { diff --git a/src/m365/spo/commands/listitem/listitem-add.ts b/src/m365/spo/commands/listitem/listitem-add.ts index 9cbc680d010..4bc3f4c3095 100644 --- a/src/m365/spo/commands/listitem/listitem-add.ts +++ b/src/m365/spo/commands/listitem/listitem-add.ts @@ -77,7 +77,7 @@ class SpoListItemAddCommand extends SpoCommand { option: '-c, --contentType [contentType]' }, { - option: '-f, --folder [folder]' + option: '--folder [folder]' } ); } diff --git a/src/m365/spo/commands/listitem/listitem-list.ts b/src/m365/spo/commands/listitem/listitem-list.ts index 683d7495734..8a5695e2275 100644 --- a/src/m365/spo/commands/listitem/listitem-list.ts +++ b/src/m365/spo/commands/listitem/listitem-list.ts @@ -86,7 +86,7 @@ class SpoListItemListCommand extends SpoCommand { option: '-q, --camlQuery [camlQuery]' }, { - option: '-f, --fields [fields]' + option: '--fields [fields]' }, { option: '-l, --filter [filter]' diff --git a/src/m365/spo/commands/listitem/listitem-remove.spec.ts b/src/m365/spo/commands/listitem/listitem-remove.spec.ts index d837346bdfc..ccc100bd81b 100644 --- a/src/m365/spo/commands/listitem/listitem-remove.spec.ts +++ b/src/m365/spo/commands/listitem/listitem-remove.spec.ts @@ -220,7 +220,7 @@ describe(commands.LISTITEM_REMOVE, () => { debug: true, title: actionTitle, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }), new CommandError(err)); }); @@ -241,7 +241,7 @@ describe(commands.LISTITEM_REMOVE, () => { id: actionId, listId: '12345', webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); }); @@ -263,7 +263,7 @@ describe(commands.LISTITEM_REMOVE, () => { listTitle: 'Documents', recycle: true, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); }); diff --git a/src/m365/spo/commands/listitem/listitem-remove.ts b/src/m365/spo/commands/listitem/listitem-remove.ts index 5d2b7b165c2..f82337edeeb 100644 --- a/src/m365/spo/commands/listitem/listitem-remove.ts +++ b/src/m365/spo/commands/listitem/listitem-remove.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { listUrl?: string; id: string; recycle?: boolean; - confirm?: boolean; + force?: boolean; } class SpoListItemRemoveCommand extends SpoCommand { @@ -47,7 +47,7 @@ class SpoListItemRemoveCommand extends SpoCommand { listTitle: typeof args.options.listTitle !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', recycle: !!args.options.recycle, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -73,7 +73,7 @@ class SpoListItemRemoveCommand extends SpoCommand { option: '--recycle' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -150,7 +150,7 @@ class SpoListItemRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeListItem(); } else { diff --git a/src/m365/spo/commands/listitem/listitem-retentionlabel-remove.spec.ts b/src/m365/spo/commands/listitem/listitem-retentionlabel-remove.spec.ts index 8d141af9123..9dff83ff46a 100644 --- a/src/m365/spo/commands/listitem/listitem-retentionlabel-remove.spec.ts +++ b/src/m365/spo/commands/listitem/listitem-retentionlabel-remove.spec.ts @@ -165,7 +165,7 @@ describe(commands.LISTITEM_RETENTIONLABEL_REMOVE, () => { await assert.doesNotReject(command.action(logger, { options: { debug: true, - confirm: true, + force: true, listUrl: listUrl, webUrl: 'https://contoso.sharepoint.com', listItemId: 1 @@ -204,7 +204,7 @@ describe(commands.LISTITEM_RETENTIONLABEL_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - confirm: true, + force: true, listUrl: listUrl, webUrl: 'https://contoso.sharepoint.com', listItemId: 1 diff --git a/src/m365/spo/commands/listitem/listitem-retentionlabel-remove.ts b/src/m365/spo/commands/listitem/listitem-retentionlabel-remove.ts index 260b5dcd6be..a9806b0f93c 100644 --- a/src/m365/spo/commands/listitem/listitem-retentionlabel-remove.ts +++ b/src/m365/spo/commands/listitem/listitem-retentionlabel-remove.ts @@ -18,7 +18,7 @@ export interface Options extends GlobalOptions { listTitle?: string; listUrl?: string; listItemId: string; - confirm?: boolean; + force?: boolean; } class SpoListItemRetentionLabelRemoveCommand extends SpoCommand { @@ -45,7 +45,7 @@ class SpoListItemRetentionLabelRemoveCommand extends SpoCommand { listId: typeof args.options.listId !== 'undefined', listTitle: typeof args.options.listTitle !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -68,7 +68,7 @@ class SpoListItemRetentionLabelRemoveCommand extends SpoCommand { option: '--listUrl [listUrl]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -101,7 +101,7 @@ class SpoListItemRetentionLabelRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeListItemRetentionLabel(logger, args); } else { diff --git a/src/m365/spo/commands/listitem/listitem-roleassignment-remove.spec.ts b/src/m365/spo/commands/listitem/listitem-roleassignment-remove.spec.ts index abdf1be49a7..b6e618bb4e6 100644 --- a/src/m365/spo/commands/listitem/listitem-roleassignment-remove.spec.ts +++ b/src/m365/spo/commands/listitem/listitem-roleassignment-remove.spec.ts @@ -128,7 +128,7 @@ describe(commands.LISTITEM_ROLEASSIGNMENT_REMOVE, () => { listTitle: 'test', listItemId: 1, principalId: 11, - confirm: true + force: true } }); }); @@ -149,7 +149,7 @@ describe(commands.LISTITEM_ROLEASSIGNMENT_REMOVE, () => { listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', listItemId: 1, principalId: 11, - confirm: true + force: true } }); }); @@ -170,7 +170,7 @@ describe(commands.LISTITEM_ROLEASSIGNMENT_REMOVE, () => { listUrl: 'sites/documents', listItemId: 1, principalId: 11, - confirm: true + force: true } }); }); @@ -201,7 +201,7 @@ describe(commands.LISTITEM_ROLEASSIGNMENT_REMOVE, () => { listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', listItemId: 1, upn: 'someaccount@tenant.onmicrosoft.com', - confirm: true + force: true } }); }); @@ -231,7 +231,7 @@ describe(commands.LISTITEM_ROLEASSIGNMENT_REMOVE, () => { listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', listItemId: 1, upn: 'someaccount@tenant.onmicrosoft.com', - confirm: true + force: true } } as any), new CommandError(error)); }); @@ -262,7 +262,7 @@ describe(commands.LISTITEM_ROLEASSIGNMENT_REMOVE, () => { listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', listItemId: 1, groupName: 'someGroup', - confirm: true + force: true } }); }); @@ -292,7 +292,7 @@ describe(commands.LISTITEM_ROLEASSIGNMENT_REMOVE, () => { listId: '0CD891EF-AFCE-4E55-B836-FCE03286CCCF', listItemId: 1, groupName: 'someGroup', - confirm: true + force: true } } as any), new CommandError(error)); }); diff --git a/src/m365/spo/commands/listitem/listitem-roleassignment-remove.ts b/src/m365/spo/commands/listitem/listitem-roleassignment-remove.ts index 88ee5dec804..d80b3ff11fb 100644 --- a/src/m365/spo/commands/listitem/listitem-roleassignment-remove.ts +++ b/src/m365/spo/commands/listitem/listitem-roleassignment-remove.ts @@ -27,7 +27,7 @@ interface Options extends GlobalOptions { principalId?: number; upn?: string; groupName?: string; - confirm?: boolean; + force?: boolean; } class SpoListItemRoleAssignmentRemoveCommand extends SpoCommand { @@ -57,7 +57,7 @@ class SpoListItemRoleAssignmentRemoveCommand extends SpoCommand { principalId: typeof args.options.principalId !== 'undefined', upn: typeof args.options.upn !== 'undefined', groupName: typeof args.options.groupName !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -89,7 +89,7 @@ class SpoListItemRoleAssignmentRemoveCommand extends SpoCommand { option: '--groupName [groupName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -127,7 +127,7 @@ class SpoListItemRoleAssignmentRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeRoleAssignment(logger, args.options); } else { diff --git a/src/m365/spo/commands/listitem/listitem-roleinheritance-break.spec.ts b/src/m365/spo/commands/listitem/listitem-roleinheritance-break.spec.ts index 6df833f4a81..734a8dd3d0e 100644 --- a/src/m365/spo/commands/listitem/listitem-roleinheritance-break.spec.ts +++ b/src/m365/spo/commands/listitem/listitem-roleinheritance-break.spec.ts @@ -148,7 +148,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_BREAK, () => { webUrl: 'https://contoso.sharepoint.com', listTitle: 'test', listItemId: 1, - confirm: true + force: true } }); }); @@ -169,7 +169,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_BREAK, () => { listTitle: 'test', listItemId: 1, clearExistingPermissions: true, - confirm: true + force: true } }); }); @@ -189,7 +189,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_BREAK, () => { webUrl: 'https://contoso.sharepoint.com', listItemId: 1, listId: '202b8199-b9de-43fd-9737-7f213f51c991', - confirm: true + force: true } }); }); @@ -210,7 +210,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_BREAK, () => { listId: '202b8199-b9de-43fd-9737-7f213f51c991', listItemId: 1, clearExistingPermissions: true, - confirm: true + force: true } }); }); @@ -231,7 +231,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_BREAK, () => { webUrl: 'https://contoso.sharepoint.com', listItemId: 1, listTitle: 'test', - confirm: true + force: true } }), new CommandError(err)); }); @@ -310,7 +310,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_BREAK, () => { webUrl: webUrl, listUrl: listUrl, listItemId: listItemId, - confirm: true + force: true } }); }); diff --git a/src/m365/spo/commands/listitem/listitem-roleinheritance-break.ts b/src/m365/spo/commands/listitem/listitem-roleinheritance-break.ts index 8f401fdbed0..47eb9cce590 100644 --- a/src/m365/spo/commands/listitem/listitem-roleinheritance-break.ts +++ b/src/m365/spo/commands/listitem/listitem-roleinheritance-break.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { listTitle?: string; listUrl?: string; clearExistingPermissions?: boolean; - confirm?: boolean; + force?: boolean; } class SpoListItemRoleInheritanceBreakCommand extends SpoCommand { @@ -47,7 +47,7 @@ class SpoListItemRoleInheritanceBreakCommand extends SpoCommand { listTitle: typeof args.options.listTitle !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', clearExistingPermissions: args.options.clearExistingPermissions === true, - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -73,7 +73,7 @@ class SpoListItemRoleInheritanceBreakCommand extends SpoCommand { option: '-c, --clearExistingPermissions' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -108,7 +108,7 @@ class SpoListItemRoleInheritanceBreakCommand extends SpoCommand { logger.logToStderr(`Breaking role inheritance of list item in site at ${args.options.webUrl}...`); } - if (args.options.confirm) { + if (args.options.force) { await this.breakListItemRoleInheritance(args.options); } else { diff --git a/src/m365/spo/commands/listitem/listitem-roleinheritance-reset.spec.ts b/src/m365/spo/commands/listitem/listitem-roleinheritance-reset.spec.ts index 666864dc6aa..53e84a97d5c 100644 --- a/src/m365/spo/commands/listitem/listitem-roleinheritance-reset.spec.ts +++ b/src/m365/spo/commands/listitem/listitem-roleinheritance-reset.spec.ts @@ -149,7 +149,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_RESET, () => { webUrl: 'https://contoso.sharepoint.com', listItemId: 8, listTitle: 'test', - confirm: true + force: true } }); }); @@ -169,7 +169,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_RESET, () => { webUrl: 'https://contoso.sharepoint.com', listItemId: 8, listId: '0cd891ef-afce-4e55-b836-fce03286cccf', - confirm: true + force: true } }); }); @@ -194,7 +194,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_RESET, () => { webUrl: webUrl, listItemId: listItemId, listUrl: listUrl, - confirm: true + force: true } }); }); @@ -215,7 +215,7 @@ describe(commands.LISTITEM_ROLEINHERITANCE_RESET, () => { webUrl: 'https://contoso.sharepoint.com', listItemId: 8, listTitle: 'test', - confirm: true + force: true } }), new CommandError(err)); }); diff --git a/src/m365/spo/commands/listitem/listitem-roleinheritance-reset.ts b/src/m365/spo/commands/listitem/listitem-roleinheritance-reset.ts index 3687d3ddc6a..1f027e6d6c3 100644 --- a/src/m365/spo/commands/listitem/listitem-roleinheritance-reset.ts +++ b/src/m365/spo/commands/listitem/listitem-roleinheritance-reset.ts @@ -18,7 +18,7 @@ interface Options extends GlobalOptions { listId?: string; listTitle?: string; listUrl?: string; - confirm?: boolean; + force?: boolean; } class SpoListItemRoleInheritanceResetCommand extends SpoCommand { @@ -45,7 +45,7 @@ class SpoListItemRoleInheritanceResetCommand extends SpoCommand { listId: typeof args.options.listId !== 'undefined', listTitle: typeof args.options.listTitle !== 'undefined', listUrl: typeof args.options.listUrl !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -68,7 +68,7 @@ class SpoListItemRoleInheritanceResetCommand extends SpoCommand { option: '--listUrl [listUrl]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -103,7 +103,7 @@ class SpoListItemRoleInheritanceResetCommand extends SpoCommand { logger.logToStderr(`Restore role inheritance of list item in site at ${args.options.webUrl}...`); } - if (args.options.confirm) { + if (args.options.force) { await this.resetListItemRoleInheritance(args.options); } else { diff --git a/src/m365/spo/commands/navigation/navigation-node-remove.spec.ts b/src/m365/spo/commands/navigation/navigation-node-remove.spec.ts index 6e5dd208d9c..3ff0d8d83db 100644 --- a/src/m365/spo/commands/navigation/navigation-node-remove.spec.ts +++ b/src/m365/spo/commands/navigation/navigation-node-remove.spec.ts @@ -73,7 +73,7 @@ describe(commands.NAVIGATION_NODE_REMOVE, () => { }); it('has correct name', () => { - assert.strictEqual(command.name,commands.NAVIGATION_NODE_REMOVE); + assert.strictEqual(command.name, commands.NAVIGATION_NODE_REMOVE); }); it('has a description', () => { @@ -89,7 +89,7 @@ describe(commands.NAVIGATION_NODE_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/team-a', location: 'TopNavigationBar', id: '2003', confirm: true } }); + await command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/team-a', location: 'TopNavigationBar', id: '2003', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -102,7 +102,7 @@ describe(commands.NAVIGATION_NODE_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/team-a', location: 'TopNavigationBar', id: '2003', confirm: true } }); + await command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com/sites/team-a', location: 'TopNavigationBar', id: '2003', force: true } }); assert(loggerLogToStderrSpy.called); }); @@ -150,7 +150,7 @@ describe(commands.NAVIGATION_NODE_REMOVE, () => { throw { error: 'An error has occurred' }; }); - await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/team-a', location: 'TopNavigationBar', id: '2003', confirm: true } } as any), new CommandError('An error has occurred')); + await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/team-a', location: 'TopNavigationBar', id: '2003', force: true } } as any), new CommandError('An error has occurred')); }); it('correctly handles random API error (string error)', async () => { @@ -158,7 +158,7 @@ describe(commands.NAVIGATION_NODE_REMOVE, () => { throw 'An error has occurred'; }); - await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/team-a', location: 'TopNavigationBar', id: '2003', confirm: true } } as any), new CommandError('An error has occurred')); + await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/sites/team-a', location: 'TopNavigationBar', id: '2003', force: true } } as any), new CommandError('An error has occurred')); }); it('fails validation if webUrl is not a valid SharePoint URL', async () => { diff --git a/src/m365/spo/commands/navigation/navigation-node-remove.ts b/src/m365/spo/commands/navigation/navigation-node-remove.ts index f2e6097fc04..ce83f6cd951 100644 --- a/src/m365/spo/commands/navigation/navigation-node-remove.ts +++ b/src/m365/spo/commands/navigation/navigation-node-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; id: string; location: string; webUrl: string; @@ -39,7 +39,7 @@ class SpoNavigationNodeRemoveCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { location: args.options.location, - confirm: typeof args.options.confirm !== 'undefined' + force: typeof args.options.force !== 'undefined' }); }); } @@ -57,7 +57,7 @@ class SpoNavigationNodeRemoveCommand extends SpoCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -86,7 +86,7 @@ class SpoNavigationNodeRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeNode(logger, args.options); } else { diff --git a/src/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.spec.ts b/src/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.spec.ts index e12bd066a8e..1ccf839b294 100644 --- a/src/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.spec.ts +++ b/src/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.spec.ts @@ -150,7 +150,7 @@ describe(commands.ORGASSETSLIBRARY_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { libraryUrl: '/sites/branding/assets', confirm: true } }); + await command.action(logger, { options: { libraryUrl: '/sites/branding/assets', force: true } }); assert(orgAssetLibRemoveCallIssued); }); @@ -202,7 +202,7 @@ describe(commands.ORGASSETSLIBRARY_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { libraryUrl: '/sites/branding/assets', debug: true, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { libraryUrl: '/sites/branding/assets', debug: true, force: true } } as any), new CommandError(`Run Add-SPOOrgAssetsLibrary first to set up the organization assets library feature for your organization.`)); }); @@ -211,7 +211,7 @@ describe(commands.ORGASSETSLIBRARY_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - confirm: true + force: true } } as any), new CommandError(`An error has occurred`)); }); diff --git a/src/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.ts b/src/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.ts index f8e076f458b..cfb663012a9 100644 --- a/src/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.ts +++ b/src/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { libraryUrl: string; - confirm?: boolean; + force?: boolean; } class SpoOrgAssetsLibraryRemoveCommand extends SpoCommand { @@ -37,13 +37,13 @@ class SpoOrgAssetsLibraryRemoveCommand extends SpoCommand { option: '--libraryUrl ' }, { - option: '--confirm' + option: '-f, --force' } ); } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeLibrary(logger, args.options.libraryUrl); } else { diff --git a/src/m365/spo/commands/orgnewssite/orgnewssite-remove.spec.ts b/src/m365/spo/commands/orgnewssite/orgnewssite-remove.spec.ts index e7b602a9e4a..67c4df44b6e 100644 --- a/src/m365/spo/commands/orgnewssite/orgnewssite-remove.spec.ts +++ b/src/m365/spo/commands/orgnewssite/orgnewssite-remove.spec.ts @@ -92,7 +92,7 @@ describe(commands.ORGNEWSSITE_REMOVE, () => { await command.action(logger, { options: { verbose: true, - confirm: true, + force: true, url: "http://contoso.sharepoint.com/sites/site1" } } as any); @@ -118,7 +118,7 @@ describe(commands.ORGNEWSSITE_REMOVE, () => { await command.action(logger, { options: { verbose: true, - confirm: false, + force: false, url: "http://contoso.sharepoint.com/sites/site1" } } as any); @@ -146,7 +146,7 @@ describe(commands.ORGNEWSSITE_REMOVE, () => { await assert.rejects(command.action(logger, { options: { debug: true, - confirm: true + force: true } } as any), new CommandError('An error has occurred')); assert(svcListRequest.called); @@ -155,12 +155,12 @@ describe(commands.ORGNEWSSITE_REMOVE, () => { it('correctly handles random API error', async () => { sinon.stub(request, 'post').rejects(new Error('An error has occurred')); - await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/site1', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/site1', force: true } } as any), new CommandError('An error has occurred')); }); it('prompts before removing', async () => { - await command.action(logger, { options: { debug: true, verbose: true, confirm: false, url: 'https://contoso.sharepoint.com/sites/test1' } }); + await command.action(logger, { options: { debug: true, verbose: true, force: false, url: 'https://contoso.sharepoint.com/sites/test1' } }); let promptIssued = false; if (promptOptions && promptOptions.type === 'confirm') { @@ -178,7 +178,7 @@ describe(commands.ORGNEWSSITE_REMOVE, () => { sinon.stub(Cli, 'prompt').callsFake(async () => ( { continue: false } )); - await command.action(logger, { options: { debug: true, verbose: true, confirm: false, url: 'https://contoso.sharepoint.com/sites/test1' } }); + await command.action(logger, { options: { debug: true, verbose: true, force: false, url: 'https://contoso.sharepoint.com/sites/test1' } }); assert(postStub.notCalled); }); @@ -196,7 +196,7 @@ describe(commands.ORGNEWSSITE_REMOVE, () => { const options = command.options; let containsConfirmOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsConfirmOption = true; } }); diff --git a/src/m365/spo/commands/orgnewssite/orgnewssite-remove.ts b/src/m365/spo/commands/orgnewssite/orgnewssite-remove.ts index a2279c77a60..1c4a9105faf 100644 --- a/src/m365/spo/commands/orgnewssite/orgnewssite-remove.ts +++ b/src/m365/spo/commands/orgnewssite/orgnewssite-remove.ts @@ -15,7 +15,7 @@ interface CommandArgs { interface Options extends GlobalOptions { url: string; - confirm?: boolean; + force?: boolean; } class SpoOrgNewsSiteRemoveCommand extends SpoCommand { @@ -38,7 +38,7 @@ class SpoOrgNewsSiteRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -49,7 +49,7 @@ class SpoOrgNewsSiteRemoveCommand extends SpoCommand { option: '-u, --url ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -61,7 +61,7 @@ class SpoOrgNewsSiteRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeOrgNewsSite(logger, args.options.url); } else { diff --git a/src/m365/spo/commands/page/page-list.mock.ts b/src/m365/spo/commands/page/page-list.mock.ts index e8fcfdd9e76..16fd65d67cd 100644 --- a/src/m365/spo/commands/page/page-list.mock.ts +++ b/src/m365/spo/commands/page/page-list.mock.ts @@ -158,7 +158,7 @@ export const mockPageListData = [ "LastVersionCreatedBy": "Elio Struyf" }, "AlternativeUrlMap": "{\"MediaTAThumbnailPathUrl\":\"https://westeurope1-mediap.svc.ms/transform/thumbnail?provider=spo&inputFormat={.fileType}&cs=UEFHRVN8U1BP&docid={.spHost}/_api/v2.0/sharePoint:{.resourceUrl}:/driveItem&w={.widthValue}&oauth_token=bearer%20{.oauthToken}\",\"MediaTAThumbnailHostUrl\":\"https://westeurope1-mediap.svc.ms\",\"AFDCDNEnabled\":\"False\",\"CurrentSiteCDNPolicy\":\"False\",\"PublicCDNEnabled\":\"False\",\"PrivateCDNEnabled\":\"False\"}", - "CanvasContent1": "[{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":1,\"sectionIndex\":1,\"sectionFactor\":8,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"emphasis\":{},\"innerHTML\":\"


\"},{\"controlType\":3,\"displayMode\":2,\"id\":\"11290f83-f592-4e93-a511-644d2bfa93da\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":8,\"zoneIndex\":1,\"layoutIndex\":1},\"webPartId\":\"1ef5ed11-ce7b-44be-bc5e-4abd55101d16\",\"emphasis\":{},\"webPartData\":{\"dataVersion\":\"2.0\",\"description\":\"Use Markdown language to add and format text.\",\"id\":\"1ef5ed11-ce7b-44be-bc5e-4abd55101d16\",\"instanceId\":\"11290f83-f592-4e93-a511-644d2bfa93da\",\"properties\":{\"displayPreview\":true,\"lineWrapping\":true,\"miniMap\":{\"enabled\":false},\"previewState\":\"Show\",\"theme\":\"Base16Light\"},\"title\":\"doctor-placeholder\",\"serverProcessedContent\":{\"htmlStrings\":{\"html\":\"

Options ¶

\\n

Options are specified via command arguments, or within a doctor.json file (automatically gets created on initialization doctor init).

\\n

-a, --auth <auth>
\\n: Specify the authentication type to use. Values can be deviceCode (default) or password.

\\n

--username
\\n: When using password authentication, you need to pass the username and password.

\\n

--password
\\n: When using password authentication, you need to pass the username and password.

\\n

-f, --folder <folder>
\\n: The folder location in where you will create your markdown files.

\\n

-u, --url <url>
\\n: The URL of the site collection to use.

\\n

--library
\\n: Specified the library which you want to use in SharePoint to store your referenced images.

\\n

--webPartTitle
\\n: This defined the title of the markdown web part to be created/updated on the page. Default value is: doctor-placeholder.

\\n

> Important: if you would change this value, be sure to keep this in the doctor.json file.

\\n

--overwriteImages
\\n: Specifies if you allow doctor to overwrite the images in the SharePoint library that are referenced in the markdown files.

\\n

--skipPrecheck
\\n: Skips the pre-checks when running the commands. This validates if you have the right dependencies installed in your environment.

\\n

doctor.json ¶

\\n

You can provide the same flags and values like in the parameters. Parameters can override what is defined in the doctor.json. Be sure to use the whole argument names, and not the shortcodes.

\\n
{\\n  &quot;folder&quot;: &quot;./src&quot;,\\n  &quot;url&quot;: &quot;https://<tenant>.sharepoint.com/sites/<documentation>&quot;,\\n  ...\\n}\\n
\\n

You can also define a static navigation structure in the doctor.json file. Example:

\\n
{\\n  &quot;menu&quot;: {\\n    &quot;QuickLaunch&quot;: {\\n      &quot;items&quot;: [{\\n        &quot;id&quot;: &quot;documentation&quot;,\\n        &quot;name&quot;: &quot;Documentation&quot;,\\n        &quot;url&quot;: &quot;&quot;\\n      }]\\n    }\\n  }\\n}\\n
\\n

The menu property can contain a QuickLaunch and/or TopNavigationBar elment with their corresponding static navigation links under the items property. More information about navigation items can be found in the menu section.

\\n

> Important: If you specify arguments during command execution, they will be used instead of the values defined in the doctor.json file.

\\n

Navigation ¶

\\n\\n\"},\"searchablePlainTexts\":{\"code\":\"\\n## Options\\n\\nOptions are specified via command arguments, or within a `doctor.json` file (automatically gets created on initialization `doctor init`).\\n\\n`-a, --auth `\\n: Specify the authentication type to use. Values can be `deviceCode` (default) or `password`.\\n\\n\\n`--username`\\n: When using `password` authentication, you need to pass the `username` and `password`.\\n\\n\\n`--password`\\n: When using `password` authentication, you need to pass the `username` and `password`.\\n\\n\\n`-f, --folder `\\n: The folder location in where you will create your markdown files.\\n\\n\\n`-u, --url `\\n: The URL of the site collection to use.\\n\\n\\n`--library`\\n: Specified the library which you want to use in SharePoint to store your referenced images.\\n\\n\\n`--webPartTitle`\\n: This defined the title of the markdown web part to be created/updated on the page. Default value is: `doctor-placeholder`.\\n\\n> **Important**: if you would change this value, be sure to keep this in the `doctor.json` file. \\n\\n\\n`--overwriteImages`\\n: Specifies if you allow `doctor` to overwrite the images in the SharePoint library that are referenced in the markdown files.\\n\\n\\n`--skipPrecheck`\\n: Skips the pre-checks when running the commands. This validates if you have the right dependencies installed in your environment.\\n\\n### `doctor.json`\\n\\nYou can provide the same flags and values like in the parameters. Parameters can override what is defined in the `doctor.json`. Be sure to use the whole argument names, and not the shortcodes.\\n\\n```json\\n{\\n \\\"folder\\\": \\\"./src\\\",\\n \\\"url\\\": \\\"https://.sharepoint.com/sites/\\\",\\n ...\\n}\\n```\\n\\nYou can also define a static navigation structure in the `doctor.json` file. Example:\\n\\n```json\\n{\\n \\\"menu\\\": {\\n \\\"QuickLaunch\\\": {\\n \\\"items\\\": [{\\n \\\"id\\\": \\\"documentation\\\",\\n \\\"name\\\": \\\"Documentation\\\",\\n \\\"url\\\": \\\"\\\"\\n }]\\n }\\n }\\n}\\n```\\n\\nThe menu property can contain a `QuickLaunch` and/or `TopNavigationBar` elment with their corresponding static navigation links under the `items` property. More information about navigation items can be found in the [menu section](#Menu).\\n\\n> **Important**: If you specify arguments during command execution, they will be used instead of the values defined in the `doctor.json` file.\\n\\n## Navigation\\n\\n- [Home](https://contoso.sharepoint.com/sites/Doctor/sitepages/home.aspx)\\n- [Documentation](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/documentation.aspx)\\n - [Options](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/options.aspx)\\n - [Installation](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/installation.aspx)\\n - [Page Creation](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/page-creation.aspx)\\n - [Commands](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/commands.aspx)\"},\"imageSources\":{},\"links\":{}}}},{\"controlType\":4,\"id\":\"fae27857-1799-4081-a08f-73742bd5f266\",\"position\":{\"zoneIndex\":1,\"sectionIndex\":2,\"controlIndex\":1,\"sectionFactor\":4,\"layoutIndex\":1},\"emphasis\":{},\"addedFromPersistedData\":true,\"innerHTML\":\"

Page template content

This is some content to test out the page template.

\"},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]", + "CanvasContent1": "[{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":1,\"sectionIndex\":1,\"sectionFactor\":8,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"emphasis\":{},\"innerHTML\":\"


\"},{\"controlType\":3,\"displayMode\":2,\"id\":\"11290f83-f592-4e93-a511-644d2bfa93da\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":8,\"zoneIndex\":1,\"layoutIndex\":1},\"webPartId\":\"1ef5ed11-ce7b-44be-bc5e-4abd55101d16\",\"emphasis\":{},\"webPartData\":{\"dataVersion\":\"2.0\",\"description\":\"Use Markdown language to add and format text.\",\"id\":\"1ef5ed11-ce7b-44be-bc5e-4abd55101d16\",\"instanceId\":\"11290f83-f592-4e93-a511-644d2bfa93da\",\"properties\":{\"displayPreview\":true,\"lineWrapping\":true,\"miniMap\":{\"enabled\":false},\"previewState\":\"Show\",\"theme\":\"Base16Light\"},\"title\":\"doctor-placeholder\",\"serverProcessedContent\":{\"htmlStrings\":{\"html\":\"

Options ¶

\\n

Options are specified via command arguments, or within a doctor.json file (automatically gets created on initialization doctor init).

\\n

-a, --auth <auth>
\\n: Specify the authentication type to use. Values can be deviceCode (default) or password.

\\n

--username
\\n: When using password authentication, you need to pass the username and password.

\\n

--password
\\n: When using password authentication, you need to pass the username and password.

\\n

--folder <folder>
\\n: The folder location in where you will create your markdown files.

\\n

-u, --url <url>
\\n: The URL of the site collection to use.

\\n

--library
\\n: Specified the library which you want to use in SharePoint to store your referenced images.

\\n

--webPartTitle
\\n: This defined the title of the markdown web part to be created/updated on the page. Default value is: doctor-placeholder.

\\n

> Important: if you would change this value, be sure to keep this in the doctor.json file.

\\n

--overwriteImages
\\n: Specifies if you allow doctor to overwrite the images in the SharePoint library that are referenced in the markdown files.

\\n

--skipPrecheck
\\n: Skips the pre-checks when running the commands. This validates if you have the right dependencies installed in your environment.

\\n

doctor.json ¶

\\n

You can provide the same flags and values like in the parameters. Parameters can override what is defined in the doctor.json. Be sure to use the whole argument names, and not the shortcodes.

\\n
{\\n  &quot;folder&quot;: &quot;./src&quot;,\\n  &quot;url&quot;: &quot;https://<tenant>.sharepoint.com/sites/<documentation>&quot;,\\n  ...\\n}\\n
\\n

You can also define a static navigation structure in the doctor.json file. Example:

\\n
{\\n  &quot;menu&quot;: {\\n    &quot;QuickLaunch&quot;: {\\n      &quot;items&quot;: [{\\n        &quot;id&quot;: &quot;documentation&quot;,\\n        &quot;name&quot;: &quot;Documentation&quot;,\\n        &quot;url&quot;: &quot;&quot;\\n      }]\\n    }\\n  }\\n}\\n
\\n

The menu property can contain a QuickLaunch and/or TopNavigationBar elment with their corresponding static navigation links under the items property. More information about navigation items can be found in the menu section.

\\n

> Important: If you specify arguments during command execution, they will be used instead of the values defined in the doctor.json file.

\\n

Navigation ¶

\\n\\n\"},\"searchablePlainTexts\":{\"code\":\"\\n## Options\\n\\nOptions are specified via command arguments, or within a `doctor.json` file (automatically gets created on initialization `doctor init`).\\n\\n`-a, --auth `\\n: Specify the authentication type to use. Values can be `deviceCode` (default) or `password`.\\n\\n\\n`--username`\\n: When using `password` authentication, you need to pass the `username` and `password`.\\n\\n\\n`--password`\\n: When using `password` authentication, you need to pass the `username` and `password`.\\n\\n\\n`--folder `\\n: The folder location in where you will create your markdown files.\\n\\n\\n`-u, --url `\\n: The URL of the site collection to use.\\n\\n\\n`--library`\\n: Specified the library which you want to use in SharePoint to store your referenced images.\\n\\n\\n`--webPartTitle`\\n: This defined the title of the markdown web part to be created/updated on the page. Default value is: `doctor-placeholder`.\\n\\n> **Important**: if you would change this value, be sure to keep this in the `doctor.json` file. \\n\\n\\n`--overwriteImages`\\n: Specifies if you allow `doctor` to overwrite the images in the SharePoint library that are referenced in the markdown files.\\n\\n\\n`--skipPrecheck`\\n: Skips the pre-checks when running the commands. This validates if you have the right dependencies installed in your environment.\\n\\n### `doctor.json`\\n\\nYou can provide the same flags and values like in the parameters. Parameters can override what is defined in the `doctor.json`. Be sure to use the whole argument names, and not the shortcodes.\\n\\n```json\\n{\\n \\\"folder\\\": \\\"./src\\\",\\n \\\"url\\\": \\\"https://.sharepoint.com/sites/\\\",\\n ...\\n}\\n```\\n\\nYou can also define a static navigation structure in the `doctor.json` file. Example:\\n\\n```json\\n{\\n \\\"menu\\\": {\\n \\\"QuickLaunch\\\": {\\n \\\"items\\\": [{\\n \\\"id\\\": \\\"documentation\\\",\\n \\\"name\\\": \\\"Documentation\\\",\\n \\\"url\\\": \\\"\\\"\\n }]\\n }\\n }\\n}\\n```\\n\\nThe menu property can contain a `QuickLaunch` and/or `TopNavigationBar` elment with their corresponding static navigation links under the `items` property. More information about navigation items can be found in the [menu section](#Menu).\\n\\n> **Important**: If you specify arguments during command execution, they will be used instead of the values defined in the `doctor.json` file.\\n\\n## Navigation\\n\\n- [Home](https://contoso.sharepoint.com/sites/Doctor/sitepages/home.aspx)\\n- [Documentation](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/documentation.aspx)\\n - [Options](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/options.aspx)\\n - [Installation](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/installation.aspx)\\n - [Page Creation](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/page-creation.aspx)\\n - [Commands](https://contoso.sharepoint.com/sites/Doctor/sitepages/doctor/commands.aspx)\"},\"imageSources\":{},\"links\":{}}}},{\"controlType\":4,\"id\":\"fae27857-1799-4081-a08f-73742bd5f266\",\"position\":{\"zoneIndex\":1,\"sectionIndex\":2,\"controlIndex\":1,\"sectionFactor\":4,\"layoutIndex\":1},\"emphasis\":{},\"addedFromPersistedData\":true,\"innerHTML\":\"

Page template content

This is some content to test out the page template.

\"},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true}}]", "LayoutWebpartsContent": "[{\"id\":\"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788\",\"instanceId\":\"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788\",\"title\":\"\\n Title area\\n \",\"description\":\"\\n Title area description\\n \",\"audiences\":[],\"serverProcessedContent\":{\"htmlStrings\":{},\"searchablePlainTexts\":{},\"imageSources\":{\"imageSource\":\"/_LAYOUTS/IMAGES/SLEEKTEMPLATEIMAGETILE.JPG\"},\"links\":{},\"customMetadata\":{\"imageSource\":{}}},\"dataVersion\":\"1.4\",\"properties\":{\"imageSourceType\":2,\"title\":\"PageTemplate\",\"textAlignment\":\"Left\",\"showPublishDate\":false,\"authors\":[{\"id\":\"i:0#.f|membership|admin@contoso.onmicrosoft.com\",\"upn\":\"admin@contoso.onmicrosoft.com\",\"email\":\"admin@contoso.onmicrosoft.com\",\"name\":\"Elio Struyf\",\"role\":\"\"}],\"showTopicHeader\":false,\"authorByline\":[\"i:0#.f|membership|admin@contoso.onmicrosoft.com\"],\"layoutType\":\"CutInShape\",\"topicHeader\":\"\",\"titlePlaceholder\":\"Name your page template\",\"hasTitleBeenCommitted\":true},\"reservedHeight\":359}]" }, { diff --git a/src/m365/spo/commands/page/page-remove.spec.ts b/src/m365/spo/commands/page/page-remove.spec.ts index 27e215de44b..fe55dc69045 100644 --- a/src/m365/spo/commands/page/page-remove.spec.ts +++ b/src/m365/spo/commands/page/page-remove.spec.ts @@ -96,7 +96,7 @@ describe(commands.PAGE_REMOVE, () => { options: { name: 'page.aspx', webUrl: 'https://contoso.sharepoint.com/sites/team-a', - confirm: true + force: true } }); assert(loggerLogSpy.notCalled); @@ -110,7 +110,7 @@ describe(commands.PAGE_REMOVE, () => { debug: true, name: 'page.aspx', webUrl: 'https://contoso.sharepoint.com/sites/team-a', - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -131,7 +131,7 @@ describe(commands.PAGE_REMOVE, () => { debug: true, name: 'page.aspx', webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); assert(loggerLogToStderrSpy.called); @@ -219,7 +219,7 @@ describe(commands.PAGE_REMOVE, () => { options: { name: 'page', webUrl: 'https://contoso.sharepoint.com/sites/team-a', - confirm: true + force: true } }); assert(loggerLogSpy.notCalled); @@ -239,7 +239,7 @@ describe(commands.PAGE_REMOVE, () => { options: { name: 'page.aspx', webUrl: 'https://contoso.sharepoint.com/sites/team-a', - confirm: true + force: true } }), new CommandError('An error has occurred')); }); @@ -270,7 +270,7 @@ describe(commands.PAGE_REMOVE, () => { const options = command.options; let containsOption = false; options.forEach((o) => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/spo/commands/page/page-remove.ts b/src/m365/spo/commands/page/page-remove.ts index 902a7d97426..6d498654a85 100644 --- a/src/m365/spo/commands/page/page-remove.ts +++ b/src/m365/spo/commands/page/page-remove.ts @@ -15,7 +15,7 @@ interface CommandArgs { interface Options extends GlobalOptions { name: string; webUrl: string; - confirm?: boolean; + force?: boolean; } class SpoPageRemoveCommand extends SpoCommand { @@ -43,7 +43,7 @@ class SpoPageRemoveCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -55,7 +55,7 @@ class SpoPageRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removePage(logger, args); } else { diff --git a/src/m365/spo/commands/propertybag/propertybag-get.ts b/src/m365/spo/commands/propertybag/propertybag-get.ts index 49fdc9a69bb..0253d6d24d2 100644 --- a/src/m365/spo/commands/propertybag/propertybag-get.ts +++ b/src/m365/spo/commands/propertybag/propertybag-get.ts @@ -49,7 +49,7 @@ class SpoPropertyBagGetCommand extends SpoPropertyBagBaseCommand { option: '-k, --key ' }, { - option: '-f, --folder [folder]' + option: '--folder [folder]' } ); } diff --git a/src/m365/spo/commands/propertybag/propertybag-list.ts b/src/m365/spo/commands/propertybag/propertybag-list.ts index f3710e5d49a..7f77fc1d5b2 100644 --- a/src/m365/spo/commands/propertybag/propertybag-list.ts +++ b/src/m365/spo/commands/propertybag/propertybag-list.ts @@ -45,7 +45,7 @@ class SpoPropertyBagListCommand extends SpoPropertyBagBaseCommand { option: '-u, --webUrl ' }, { - option: '-f, --folder [folder]' + option: '--folder [folder]' } ); } diff --git a/src/m365/spo/commands/propertybag/propertybag-remove.spec.ts b/src/m365/spo/commands/propertybag/propertybag-remove.spec.ts index 18113bce8b5..fa1f5b9e707 100644 --- a/src/m365/spo/commands/propertybag/propertybag-remove.spec.ts +++ b/src/m365/spo/commands/propertybag/propertybag-remove.spec.ts @@ -158,7 +158,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { verbose: false, webUrl: 'https://contoso.sharepoint.com', key: 'key1', - confirm: true + force: true } }); assert(loggerLogSpy.notCalled); @@ -223,7 +223,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', key: 'key1', debug: true, - confirm: true + force: true }; const objIdentity: IdentityResponse = { objectIdentity: "38e4499e-10a2-5000-ce25-77d4ccc2bd96|740c6a0b-85e2-48a0-a494-e0f1759d4a77:site:f3806c23-0c9f-42d3-bc7d-3895acc06d73:web:5a39e548-b3d7-4090-9cb9-0ce7cd85d275", @@ -253,7 +253,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', key: 'key1', folder: '/', - confirm: true + force: true }; const objIdentity: IdentityResponse = { objectIdentity: "93e5499e-00f1-5000-1f36-3ab12512a7e9|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:f3806c23-0c9f-42d3-bc7d-3895acc06dc3:web:5a39e548-b3d7-4090-9cb9-0ce7cd85d2c5:folder:df4291de-226f-4c39-bbcc-df21915f5fc1", @@ -272,7 +272,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com/sites/abc', key: 'key1', folder: '/Shared Documents', - confirm: true + force: true }; const objIdentity: IdentityResponse = { objectIdentity: "93e5499e-00f1-5000-1f36-3ab12512a7e9|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:f3806c23-0c9f-42d3-bc7d-3895acc06dc3:web:5a39e548-b3d7-4090-9cb9-0ce7cd85d2c5:folder:df4291de-226f-4c39-bbcc-df21915f5fc1", @@ -289,7 +289,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { const options = { webUrl: 'https://contoso.sharepoint.com', key: 'key1', - confirm: true + force: true }; const objIdentity: IdentityResponse = { objectIdentity: "38e4499e-10a2-5000-ce25-77d4ccc2bd96|740c6a0b-85e2-48a0-a494-e0f1759d4a77:site:f3806c23-0c9f-42d3-bc7d-3895acc06d73:web:5a39e548-b3d7-4090-9cb9-0ce7cd85d275", @@ -307,7 +307,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', key: 'key1', folder: '/', - confirm: true + force: true }; const objIdentity: IdentityResponse = { objectIdentity: "93e5499e-00f1-5000-1f36-3ab12512a7e9|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:f3806c23-0c9f-42d3-bc7d-3895acc06dc3:web:5a39e548-b3d7-4090-9cb9-0ce7cd85d2c5:folder:df4291de-226f-4c39-bbcc-df21915f5fc1", @@ -325,7 +325,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', key: 'key1', folder: '/', - confirm: true + force: true }; await assert.rejects(command.action(logger, { options: options } as any), @@ -339,7 +339,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', key: 'key1', folder: '/', - confirm: true + force: true }; await assert.rejects(command.action(logger, { options: options } as any), @@ -352,7 +352,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', key: 'key1', folder: '/', - confirm: true, + force: true, debug: true }; @@ -367,7 +367,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folder: '/', verbose: true, - confirm: true + force: true }; await assert.rejects(command.action(logger, { options: options } as any), @@ -381,7 +381,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folder: '/', debug: true, - confirm: true + force: true }; await assert.rejects(command.action(logger, { options: options } as any), @@ -394,7 +394,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folder: '/', key: 'vti_parentid', - confirm: true + force: true }; await assert.rejects(command.action(logger, { options: options } as any), @@ -408,7 +408,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folder: '/', verbose: true, - confirm: true + force: true }; await assert.rejects(command.action(logger, { options: options } as any), @@ -423,7 +423,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folder: '/', verbose: true, - confirm: true + force: true }; await assert.rejects(command.action(logger, { options: options } as any), @@ -437,7 +437,7 @@ describe(commands.PROPERTYBAG_REMOVE, () => { webUrl: 'https://contoso.sharepoint.com', folder: '/', verbose: true, - confirm: true + force: true }; await assert.rejects(command.action(logger, { options: options } as any), diff --git a/src/m365/spo/commands/propertybag/propertybag-remove.ts b/src/m365/spo/commands/propertybag/propertybag-remove.ts index 5290c329c68..e093750da61 100644 --- a/src/m365/spo/commands/propertybag/propertybag-remove.ts +++ b/src/m365/spo/commands/propertybag/propertybag-remove.ts @@ -17,7 +17,7 @@ export interface Options extends GlobalOptions { webUrl: string; key: string; folder?: string; - confirm?: boolean; + force?: boolean; } class SpoPropertyBagRemoveCommand extends SpoPropertyBagBaseCommand { @@ -41,7 +41,7 @@ class SpoPropertyBagRemoveCommand extends SpoPropertyBagBaseCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { folder: (!(!args.options.folder)).toString(), - confirm: args.options.confirm === true + force: args.options.force === true }); }); } @@ -55,10 +55,10 @@ class SpoPropertyBagRemoveCommand extends SpoPropertyBagBaseCommand { option: '-k, --key ' }, { - option: '-f, --folder [folder]' + option: '--folder [folder]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -89,7 +89,7 @@ class SpoPropertyBagRemoveCommand extends SpoPropertyBagBaseCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeProperty(); } else { diff --git a/src/m365/spo/commands/propertybag/propertybag-set.ts b/src/m365/spo/commands/propertybag/propertybag-set.ts index 20e2c030612..3e4e2d632e3 100644 --- a/src/m365/spo/commands/propertybag/propertybag-set.ts +++ b/src/m365/spo/commands/propertybag/propertybag-set.ts @@ -53,7 +53,7 @@ class SpoPropertyBagSetCommand extends SpoPropertyBagBaseCommand { option: '-v, --value ' }, { - option: '-f, --folder [folder]' + option: '--folder [folder]' } ); } diff --git a/src/m365/spo/commands/roledefinition/roledefinition-remove.spec.ts b/src/m365/spo/commands/roledefinition/roledefinition-remove.spec.ts index 38a44bbf31e..a9c5c5872ec 100644 --- a/src/m365/spo/commands/roledefinition/roledefinition-remove.spec.ts +++ b/src/m365/spo/commands/roledefinition/roledefinition-remove.spec.ts @@ -104,7 +104,7 @@ describe(commands.ROLEDEFINITION_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', id: 1, - confirm: true + force: true } }), new CommandError(err)); }); @@ -175,7 +175,7 @@ describe(commands.ROLEDEFINITION_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com', id: 1, confirm: true } }); + await command.action(logger, { options: { debug: true, webUrl: 'https://contoso.sharepoint.com', id: 1, force: true } }); let correctRequestIssued = false; requests.forEach(r => { if (r.url.indexOf(`/_api/web/roledefinitions(1)`) > -1 && diff --git a/src/m365/spo/commands/roledefinition/roledefinition-remove.ts b/src/m365/spo/commands/roledefinition/roledefinition-remove.ts index f581b00a66e..5c1b6fc8c2b 100644 --- a/src/m365/spo/commands/roledefinition/roledefinition-remove.ts +++ b/src/m365/spo/commands/roledefinition/roledefinition-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { webUrl: string; id: string; - confirm?: boolean; + force?: boolean; } class SpoRoleDefinitionRemoveCommand extends SpoCommand { @@ -36,7 +36,7 @@ class SpoRoleDefinitionRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -50,7 +50,7 @@ class SpoRoleDefinitionRemoveCommand extends SpoCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -69,7 +69,7 @@ class SpoRoleDefinitionRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeRoleDefinition(logger, args); } else { diff --git a/src/m365/spo/commands/serviceprincipal/serviceprincipal-set.spec.ts b/src/m365/spo/commands/serviceprincipal/serviceprincipal-set.spec.ts index eda05dd9007..e11ee303eb7 100644 --- a/src/m365/spo/commands/serviceprincipal/serviceprincipal-set.spec.ts +++ b/src/m365/spo/commands/serviceprincipal/serviceprincipal-set.spec.ts @@ -101,7 +101,7 @@ describe(commands.SERVICEPRINCIPAL_SET, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { debug: true, enabled: true, confirm: true } }); + await command.action(logger, { options: { debug: true, enabled: true, force: true } }); assert(loggerLogSpy.calledWith({ AccountEnabled: true, AppId: "57fb890c-0dab-4253-a5e0-7188c88b2bb4", @@ -132,7 +132,7 @@ describe(commands.SERVICEPRINCIPAL_SET, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { enabled: true, confirm: true } }); + await command.action(logger, { options: { enabled: true, force: true } }); assert(loggerLogSpy.calledWith({ AccountEnabled: true, AppId: "57fb890c-0dab-4253-a5e0-7188c88b2bb4", @@ -163,7 +163,7 @@ describe(commands.SERVICEPRINCIPAL_SET, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { debug: true, enabled: false, confirm: true } }); + await command.action(logger, { options: { debug: true, enabled: false, force: true } }); assert(loggerLogSpy.calledWith({ AccountEnabled: false, AppId: "57fb890c-0dab-4253-a5e0-7188c88b2bb4", @@ -183,7 +183,7 @@ describe(commands.SERVICEPRINCIPAL_SET, () => { } ])); }); - await assert.rejects(command.action(logger, { options: { confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { force: true } } as any), new CommandError('An error has occurred')); }); @@ -248,7 +248,7 @@ describe(commands.SERVICEPRINCIPAL_SET, () => { it('correctly handles random API error', async () => { sinon.stub(request, 'post').callsFake(() => Promise.reject('An error has occurred')); - await assert.rejects(command.action(logger, { options: { enabled: true, confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { enabled: true, force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/spo/commands/serviceprincipal/serviceprincipal-set.ts b/src/m365/spo/commands/serviceprincipal/serviceprincipal-set.ts index 46866e9175f..4aca91da56e 100644 --- a/src/m365/spo/commands/serviceprincipal/serviceprincipal-set.ts +++ b/src/m365/spo/commands/serviceprincipal/serviceprincipal-set.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { enabled: boolean; - confirm?: boolean; + force?: boolean; } class SpoServicePrincipalSetCommand extends SpoCommand { @@ -48,7 +48,7 @@ class SpoServicePrincipalSetCommand extends SpoCommand { autocomplete: ['true', 'false'] }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -98,7 +98,7 @@ class SpoServicePrincipalSetCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await toggleServicePrincipal(); } else { diff --git a/src/m365/spo/commands/site/site-apppermission-remove.spec.ts b/src/m365/spo/commands/site/site-apppermission-remove.spec.ts index b26466775c2..1a0785e1844 100644 --- a/src/m365/spo/commands/site/site-apppermission-remove.spec.ts +++ b/src/m365/spo/commands/site/site-apppermission-remove.spec.ts @@ -298,7 +298,7 @@ describe(commands.SITE_APPPERMISSION_REMOVE, () => { options: { siteUrl: 'https://contoso.sharepoint.com/sites/sitecollection-name', appId: '89ea5c94-7736-4e25-95ad-3fa95f62b66e', - confirm: true + force: true } }); assert(deleteRequestStub.called); @@ -332,7 +332,7 @@ describe(commands.SITE_APPPERMISSION_REMOVE, () => { options: { siteUrl: 'https://contoso.sharepoint.com/sites/sitecollection-name', appDisplayName: 'Foo', - confirm: true + force: true } }); assert(deleteRequestStub.called); @@ -347,7 +347,7 @@ describe(commands.SITE_APPPERMISSION_REMOVE, () => { options: { siteUrl: 'https://contoso.sharepoint.com/sites/sitecollection-name', appDisplayName: 'Foo', - confirm: true + force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/spo/commands/site/site-apppermission-remove.ts b/src/m365/spo/commands/site/site-apppermission-remove.ts index c563f00394b..7a423e7bf6f 100644 --- a/src/m365/spo/commands/site/site-apppermission-remove.ts +++ b/src/m365/spo/commands/site/site-apppermission-remove.ts @@ -17,7 +17,7 @@ interface Options extends GlobalOptions { appId?: string; appDisplayName?: string; id?: string; - confirm?: boolean; + force?: boolean; } class SpoSiteAppPermissionRemoveCommand extends GraphCommand { @@ -46,7 +46,7 @@ class SpoSiteAppPermissionRemoveCommand extends GraphCommand { appId: typeof args.options.appId !== 'undefined', appDisplayName: typeof args.options.appDisplayName !== 'undefined', id: typeof args.options.id !== 'undefined', - confirm: (!!args.options.confirm).toString() + force: (!!args.options.force).toString() }); }); } @@ -66,7 +66,7 @@ class SpoSiteAppPermissionRemoveCommand extends GraphCommand { option: '-n, --appDisplayName [appDisplayName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -163,7 +163,7 @@ class SpoSiteAppPermissionRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeSiteAppPermission(); } else { diff --git a/src/m365/spo/commands/site/site-hubsite-disconnect.spec.ts b/src/m365/spo/commands/site/site-hubsite-disconnect.spec.ts index 7e836b48e9f..2c9e37989f8 100644 --- a/src/m365/spo/commands/site/site-hubsite-disconnect.spec.ts +++ b/src/m365/spo/commands/site/site-hubsite-disconnect.spec.ts @@ -90,7 +90,7 @@ describe(commands.SITE_HUBSITE_DISCONNECT, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/Sales', confirm: true } }); + await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/Sales', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -105,7 +105,7 @@ describe(commands.SITE_HUBSITE_DISCONNECT, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { debug: true, siteUrl: 'https://contoso.sharepoint.com/sites/Sales', confirm: true } }); + await command.action(logger, { options: { debug: true, siteUrl: 'https://contoso.sharepoint.com/sites/Sales', force: true } }); assert(loggerLogToStderrSpy.called); }); @@ -157,7 +157,7 @@ describe(commands.SITE_HUBSITE_DISCONNECT, () => { }); }); - await assert.rejects(command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/sales', confirm: true } } as any), + await assert.rejects(command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/sales', force: true } } as any), new CommandError('Exception of type \'Microsoft.SharePoint.Client.ResourceNotFoundException\' was thrown.')); }); diff --git a/src/m365/spo/commands/site/site-hubsite-disconnect.ts b/src/m365/spo/commands/site/site-hubsite-disconnect.ts index 08631775b9f..8c1e5e2796a 100644 --- a/src/m365/spo/commands/site/site-hubsite-disconnect.ts +++ b/src/m365/spo/commands/site/site-hubsite-disconnect.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { siteUrl: string; - confirm?: boolean; + force?: boolean; } class SpoSiteHubSiteDisconnectCommand extends SpoCommand { @@ -36,7 +36,7 @@ class SpoSiteHubSiteDisconnectCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: args.options.confirm || false + force: args.options.force || false }); }); } @@ -47,7 +47,7 @@ class SpoSiteHubSiteDisconnectCommand extends SpoCommand { option: '-u, --siteUrl ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -83,7 +83,7 @@ class SpoSiteHubSiteDisconnectCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await disconnectHubSite(); } else { diff --git a/src/m365/spo/commands/site/site-list.ts b/src/m365/spo/commands/site/site-list.ts index 083186b88a9..a2ac9620e14 100644 --- a/src/m365/spo/commands/site/site-list.ts +++ b/src/m365/spo/commands/site/site-list.ts @@ -47,7 +47,7 @@ class SpoSiteListCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - webTemplate: args.options.webTemplate, + webTemplate: args.options.webTemplate, type: args.options.type, filter: (!(!args.options.filter)).toString(), deleted: args.options.deleted, @@ -66,7 +66,7 @@ class SpoSiteListCommand extends SpoCommand { option: '--webTemplate [webTemplate]' }, { - option: '-f, --filter [filter]' + option: '--filter [filter]' }, { option: '--includeOneDriveSites' @@ -81,21 +81,21 @@ class SpoSiteListCommand extends SpoCommand { this.validators.push( async (args: CommandArgs) => { if (args.options.type && args.options.webTemplate) { - return 'Specify either type or webTemplate, but not both'; - } + return 'Specify either type or webTemplate, but not both'; + } - const typeValues = ['TeamSite', 'CommunicationSite']; - if (args.options.type && - typeValues.indexOf(args.options.type) < 0) { - return `${args.options.type} is not a valid value for the type option. Allowed values are ${typeValues.join('|')}`; - } + const typeValues = ['TeamSite', 'CommunicationSite']; + if (args.options.type && + typeValues.indexOf(args.options.type) < 0) { + return `${args.options.type} is not a valid value for the type option. Allowed values are ${typeValues.join('|')}`; + } - if (args.options.includeOneDriveSites - && (args.options.type || args.options.webTemplate)) { - return 'When using includeOneDriveSites, don\'t specify the type or webTemplate options'; - } + if (args.options.includeOneDriveSites + && (args.options.type || args.options.webTemplate)) { + return 'When using includeOneDriveSites, don\'t specify the type or webTemplate options'; + } - return true; + return true; } ); } @@ -116,7 +116,7 @@ class SpoSiteListCommand extends SpoCommand { await this.getAllSites(spoAdminUrl, formatting.escapeXml(args.options.filter || ''), '0', personalSite, webTemplate, undefined, args.options.deleted, logger); logger.log(this.allSites); - } + } catch (err: any) { this.handleRejectedODataJsonPromise(err); } diff --git a/src/m365/spo/commands/site/site-recyclebinitem-clear.spec.ts b/src/m365/spo/commands/site/site-recyclebinitem-clear.spec.ts index b075d149cb9..15b11d490b6 100644 --- a/src/m365/spo/commands/site/site-recyclebinitem-clear.spec.ts +++ b/src/m365/spo/commands/site/site-recyclebinitem-clear.spec.ts @@ -70,12 +70,12 @@ describe(commands.SITE_RECYCLEBINITEM_CLEAR, () => { }); it('fails validation if the webUrl option is not a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { siteUrl: 'foo', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { siteUrl: 'foo', force: true } }, 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: { siteUrl: 'https://contoso.sharepoint.com', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', force: true } }, commandInfo); assert(actual); }); @@ -129,7 +129,7 @@ describe(commands.SITE_RECYCLEBINITEM_CLEAR, () => { options: { verbose: true, siteUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); }); @@ -175,7 +175,7 @@ describe(commands.SITE_RECYCLEBINITEM_CLEAR, () => { verbose: true, siteUrl: 'https://contoso.sharepoint.com', secondary: true, - confirm: true + force: true } }); @@ -198,7 +198,7 @@ describe(commands.SITE_RECYCLEBINITEM_CLEAR, () => { }); await assert.rejects( - command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com', confirm: true } } as any), + command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com', force: true } } as any), new CommandError(error.error['odata.error'].message.value) ); }); diff --git a/src/m365/spo/commands/site/site-recyclebinitem-clear.ts b/src/m365/spo/commands/site/site-recyclebinitem-clear.ts index a0230828f8b..dd93b79ee3d 100644 --- a/src/m365/spo/commands/site/site-recyclebinitem-clear.ts +++ b/src/m365/spo/commands/site/site-recyclebinitem-clear.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { siteUrl: string; secondary?: boolean; - confirm?: boolean; + force?: boolean; } class SpoSiteRecycleBinItemClearCommand extends SpoCommand { @@ -37,7 +37,7 @@ class SpoSiteRecycleBinItemClearCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { secondary: !!args.options.secondary, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -51,7 +51,7 @@ class SpoSiteRecycleBinItemClearCommand extends SpoCommand { option: '--secondary' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -70,7 +70,7 @@ class SpoSiteRecycleBinItemClearCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.clearRecycleBin(args, logger); } else { diff --git a/src/m365/spo/commands/site/site-recyclebinitem-move.spec.ts b/src/m365/spo/commands/site/site-recyclebinitem-move.spec.ts index 44d6de1d9c9..b72cd8838d0 100644 --- a/src/m365/spo/commands/site/site-recyclebinitem-move.spec.ts +++ b/src/m365/spo/commands/site/site-recyclebinitem-move.spec.ts @@ -70,22 +70,22 @@ describe(commands.SITE_RECYCLEBINITEM_MOVE, () => { }); it('fails validation if the webUrl option is not a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { siteUrl: 'foo', all: true, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { siteUrl: 'foo', all: true, force: true } }, 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: { siteUrl: 'https://contoso.sharepoint.com', all: true, confirm: true } }, commandInfo); + const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', all: true, force: true } }, commandInfo); assert(actual); }); it('fails validation if ids is not a valid guid array string', async () => { - const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,foo', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,foo', force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation if ids has a valid value', async () => { - const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,aecb840f-20e9-4ff8-accf-5df8eaad31a1', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,aecb840f-20e9-4ff8-accf-5df8eaad31a1', force: true } }, commandInfo); assert(actual); }); @@ -133,7 +133,7 @@ describe(commands.SITE_RECYCLEBINITEM_MOVE, () => { verbose: true, siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,aecb840f-20e9-4ff8-accf-5df8eaad31a1', - confirm: true + force: true } }); @@ -182,7 +182,7 @@ describe(commands.SITE_RECYCLEBINITEM_MOVE, () => { verbose: true, siteUrl: 'https://contoso.sharepoint.com', all: true, - confirm: true + force: true } }); @@ -204,6 +204,6 @@ describe(commands.SITE_RECYCLEBINITEM_MOVE, () => { throw error; }); - await assert.rejects(command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com', all: true, confirm: true } } as any), new CommandError(error.error['odata.error'].message.value)); + await assert.rejects(command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com', all: true, force: true } } as any), new CommandError(error.error['odata.error'].message.value)); }); }); diff --git a/src/m365/spo/commands/site/site-recyclebinitem-move.ts b/src/m365/spo/commands/site/site-recyclebinitem-move.ts index 8219262764b..7894c2deaf9 100644 --- a/src/m365/spo/commands/site/site-recyclebinitem-move.ts +++ b/src/m365/spo/commands/site/site-recyclebinitem-move.ts @@ -14,7 +14,7 @@ interface Options extends GlobalOptions { siteUrl: string; ids?: string; all?: boolean; - confirm?: boolean; + force?: boolean; } class SpoSiteRecycleBinItemMoveCommand extends SpoCommand { @@ -40,7 +40,7 @@ class SpoSiteRecycleBinItemMoveCommand extends SpoCommand { Object.assign(this.telemetryProperties, { ids: typeof args.options.ids !== 'undefined', all: !!args.options.all, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -57,7 +57,7 @@ class SpoSiteRecycleBinItemMoveCommand extends SpoCommand { option: '--all' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -86,7 +86,7 @@ class SpoSiteRecycleBinItemMoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.moveRecycleBinItem(args, logger); } else { diff --git a/src/m365/spo/commands/site/site-recyclebinitem-remove.spec.ts b/src/m365/spo/commands/site/site-recyclebinitem-remove.spec.ts index b4229c62834..0ebb44787de 100644 --- a/src/m365/spo/commands/site/site-recyclebinitem-remove.spec.ts +++ b/src/m365/spo/commands/site/site-recyclebinitem-remove.spec.ts @@ -70,17 +70,17 @@ describe(commands.SITE_RECYCLEBINITEM_REMOVE, () => { }); it('fails validation if the webUrl option is not a valid SharePoint site URL', async () => { - const actual = await command.validate({ options: { siteUrl: 'foo', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,aecb840f-20e9-4ff8-accf-5df8eaad31a1', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { siteUrl: 'foo', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,aecb840f-20e9-4ff8-accf-5df8eaad31a1', force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('fails validation if ids is not a valid guid array string', async () => { - const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,foo', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,foo', force: true } }, commandInfo); assert.notStrictEqual(actual, true); }); it('passes validation when all options are passed', async () => { - const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,aecb840f-20e9-4ff8-accf-5df8eaad31a1', confirm: true } }, commandInfo); + const actual = await command.validate({ options: { siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,aecb840f-20e9-4ff8-accf-5df8eaad31a1', force: true } }, commandInfo); assert(actual); }); @@ -128,7 +128,7 @@ describe(commands.SITE_RECYCLEBINITEM_REMOVE, () => { verbose: true, siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,aecb840f-20e9-4ff8-accf-5df8eaad31a1', - confirm: true + force: true } }); }); @@ -182,7 +182,7 @@ describe(commands.SITE_RECYCLEBINITEM_REMOVE, () => { verbose: true, siteUrl: 'https://contoso.sharepoint.com', ids: '85528dee-00d5-4c38-a6ba-e2abace32f63,aecb840f-20e9-4ff8-accf-5df8eaad31a1', - confirm: true + force: true } }), new CommandError(error.error['odata.error'].message.value)); }); diff --git a/src/m365/spo/commands/site/site-recyclebinitem-remove.ts b/src/m365/spo/commands/site/site-recyclebinitem-remove.ts index 7b2bccf86df..16aaba2de68 100644 --- a/src/m365/spo/commands/site/site-recyclebinitem-remove.ts +++ b/src/m365/spo/commands/site/site-recyclebinitem-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { siteUrl: string; ids: string; - confirm?: boolean; + force?: boolean; } class SpoSiteRecycleBinItemRemoveCommand extends SpoCommand { @@ -36,7 +36,7 @@ class SpoSiteRecycleBinItemRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -50,7 +50,7 @@ class SpoSiteRecycleBinItemRemoveCommand extends SpoCommand { option: '-i, --ids ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -73,7 +73,7 @@ class SpoSiteRecycleBinItemRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeRecycleBinItem(args, logger); } else { diff --git a/src/m365/spo/commands/site/site-remove.spec.ts b/src/m365/spo/commands/site/site-remove.spec.ts index 7767adb7ae9..3f676e8db49 100644 --- a/src/m365/spo/commands/site/site-remove.spec.ts +++ b/src/m365/spo/commands/site/site-remove.spec.ts @@ -230,7 +230,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', confirm: true, debug: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', force: true, debug: true } }); assert(loggerLogToStderrSpy.called); }); @@ -287,7 +287,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', confirm: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', force: true } }); assert(loggerLogSpy.notCalled); }); @@ -366,7 +366,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', confirm: true, debug: true, skipRecycleBin: true } } as any); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', force: true, debug: true, skipRecycleBin: true } } as any); assert(loggerLogToStderrSpy.called); }); @@ -445,7 +445,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', confirm: true, skipRecycleBin: true } } as any); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', force: true, skipRecycleBin: true } } as any); assert(loggerLogSpy.notCalled); }); @@ -502,7 +502,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', fromRecycleBin: true, confirm: true, debug: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', fromRecycleBin: true, force: true, debug: true } }); assert(loggerLogToStderrSpy.called); }); @@ -559,7 +559,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', fromRecycleBin: true, confirm: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', fromRecycleBin: true, force: true } }); assert(loggerLogSpy.notCalled); }); @@ -629,7 +629,7 @@ describe(commands.SITE_REMOVE, () => { fn(); return {} as any; }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', fromRecycleBin: true, confirm: true, debug: true, wait: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', fromRecycleBin: true, force: true, debug: true, wait: true } }); assert(loggerLogToStderrSpy.called); }); @@ -674,7 +674,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', fromRecycleBin: true, confirm: true, debug: true, wait: true } } as any), + await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', fromRecycleBin: true, force: true, debug: true, wait: true } } as any), new CommandError('An error has occurred.')); }); @@ -745,7 +745,7 @@ describe(commands.SITE_REMOVE, () => { return {} as any; }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', confirm: true, debug: true, wait: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', force: true, debug: true, wait: true } }); assert(loggerLogToStderrSpy.called); }); @@ -816,7 +816,7 @@ describe(commands.SITE_REMOVE, () => { return {} as any; }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', confirm: true, verbose: true, wait: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', force: true, verbose: true, wait: true } }); assert(loggerLogToStderrSpy.called); }); @@ -888,7 +888,7 @@ describe(commands.SITE_REMOVE, () => { return {} as any; }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', confirm: true, wait: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', force: true, wait: true } }); assert(loggerLogSpy.notCalled); }); @@ -1156,7 +1156,7 @@ describe(commands.SITE_REMOVE, () => { return {} as any; }); - await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeGrouped', debug: true, verbose: true, confirm: true, wait: true } }); + await command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeGrouped', debug: true, verbose: true, force: true, wait: true } }); assert(loggerLogToStderrSpy.called); }); @@ -1203,7 +1203,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeGrouped', debug: true, verbose: true, confirm: true } })); + await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeGrouped', debug: true, verbose: true, force: true } })); assert(loggerLogToStderrSpy.called); }); @@ -1263,7 +1263,7 @@ describe(commands.SITE_REMOVE, () => { return {} as any; }); - await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeGrouped', debug: true, verbose: true, skipRecycleBin: true, confirm: true, wait: true } }), + await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeGrouped', debug: true, verbose: true, skipRecycleBin: true, force: true, wait: true } }), new CommandError("Site group still exists in the deleted groups. The site won't be removed.")); }); @@ -1321,7 +1321,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeGrouped', debug: true, verbose: true, confirm: true } })); + await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeGrouped', debug: true, verbose: true, force: true } })); assert(loggerLogToStderrSpy.called); }); @@ -1393,7 +1393,7 @@ describe(commands.SITE_REMOVE, () => { return {} as any; }); - await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', confirm: true, wait: true } } as any), + await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', force: true, wait: true } } as any), new CommandError('An error has occurred.')); }); @@ -1438,7 +1438,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', confirm: true, debug: true } } as any), + await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demosite', force: true, debug: true } } as any), new CommandError('An error has occurred.')); }); @@ -1465,7 +1465,7 @@ describe(commands.SITE_REMOVE, () => { return Promise.reject('Cannot get site https://contoso.sharepoint.com/sites/demositeinvalid.'); }); - await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeinvalid', confirm: true, debug: true } }), + await assert.rejects(command.action(logger, { options: { url: 'https://contoso.sharepoint.com/sites/demositeinvalid', force: true, debug: true } }), new CommandError('Cannot get site https://contoso.sharepoint.com/sites/demositeinvalid.')); }); }); \ No newline at end of file diff --git a/src/m365/spo/commands/site/site-remove.ts b/src/m365/spo/commands/site/site-remove.ts index 41cc2b12ede..c71a482b0cc 100644 --- a/src/m365/spo/commands/site/site-remove.ts +++ b/src/m365/spo/commands/site/site-remove.ts @@ -20,7 +20,7 @@ interface Options extends GlobalOptions { skipRecycleBin?: boolean; fromRecycleBin?: boolean; wait: boolean; - confirm?: boolean; + force?: boolean; } class SpoSiteRemoveCommand extends SpoCommand { @@ -49,7 +49,7 @@ class SpoSiteRemoveCommand extends SpoCommand { skipRecycleBin: (!(!args.options.skipRecycleBin)).toString(), fromRecycleBin: (!(!args.options.fromRecycleBin)).toString(), wait: args.options.wait, - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -69,7 +69,7 @@ class SpoSiteRemoveCommand extends SpoCommand { option: '--wait' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -138,7 +138,7 @@ class SpoSiteRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeSite(); } else { diff --git a/src/m365/spo/commands/sitedesign/sitedesign-remove.spec.ts b/src/m365/spo/commands/sitedesign/sitedesign-remove.spec.ts index 339d437ffe2..6a6f3740d31 100644 --- a/src/m365/spo/commands/sitedesign/sitedesign-remove.spec.ts +++ b/src/m365/spo/commands/sitedesign/sitedesign-remove.spec.ts @@ -92,7 +92,7 @@ describe(commands.SITEDESIGN_REMOVE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { confirm: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } }); + await command.action(logger, { options: { force: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } }); assert(loggerLogSpy.notCalled); }); @@ -131,7 +131,7 @@ describe(commands.SITEDESIGN_REMOVE, () => { return Promise.reject({ error: { 'odata.error': { message: { value: 'File Not Found.' } } } }); }); - await assert.rejects(command.action(logger, { options: { confirm: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } } as any), new CommandError('File Not Found.')); + await assert.rejects(command.action(logger, { options: { force: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } } as any), new CommandError('File Not Found.')); }); it('supports specifying id', () => { @@ -149,7 +149,7 @@ describe(commands.SITEDESIGN_REMOVE, () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/spo/commands/sitedesign/sitedesign-remove.ts b/src/m365/spo/commands/sitedesign/sitedesign-remove.ts index 6a7dc862eed..b323bd7a51c 100644 --- a/src/m365/spo/commands/sitedesign/sitedesign-remove.ts +++ b/src/m365/spo/commands/sitedesign/sitedesign-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class SpoSiteDesignRemoveCommand extends SpoCommand { @@ -36,7 +36,7 @@ class SpoSiteDesignRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: args.options.confirm || false + force: args.options.force || false }); }); } @@ -47,7 +47,7 @@ class SpoSiteDesignRemoveCommand extends SpoCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -81,13 +81,13 @@ class SpoSiteDesignRemoveCommand extends SpoCommand { }; await request.post(requestOptions); - } + } catch (err: any) { this.handleRejectedODataJsonPromise(err); } }; - if (args.options.confirm) { + if (args.options.force) { await removeSiteDesign(); } else { @@ -97,7 +97,7 @@ class SpoSiteDesignRemoveCommand extends SpoCommand { default: false, message: `Are you sure you want to remove the site design ${args.options.id}?` }); - + if (result.continue) { await removeSiteDesign(); } diff --git a/src/m365/spo/commands/sitedesign/sitedesign-rights-revoke.spec.ts b/src/m365/spo/commands/sitedesign/sitedesign-rights-revoke.spec.ts index e1443ff7f83..ca4e4adb9aa 100644 --- a/src/m365/spo/commands/sitedesign/sitedesign-rights-revoke.spec.ts +++ b/src/m365/spo/commands/sitedesign/sitedesign-rights-revoke.spec.ts @@ -94,7 +94,7 @@ describe(commands.SITEDESIGN_RIGHTS_REVOKE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { confirm: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF' } }); + await command.action(logger, { options: { force: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF' } }); assert(loggerLogSpy.notCalled); }); @@ -113,7 +113,7 @@ describe(commands.SITEDESIGN_RIGHTS_REVOKE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { confirm: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF,AdeleV' } }); + await command.action(logger, { options: { force: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF,AdeleV' } }); assert(loggerLogSpy.notCalled); }); @@ -132,7 +132,7 @@ describe(commands.SITEDESIGN_RIGHTS_REVOKE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { confirm: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF@contoso.com,AdeleV@contoso.com' } }); + await command.action(logger, { options: { force: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF@contoso.com,AdeleV@contoso.com' } }); assert(loggerLogSpy.notCalled); }); @@ -151,7 +151,7 @@ describe(commands.SITEDESIGN_RIGHTS_REVOKE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { confirm: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF@contoso.com, AdeleV@contoso.com' } }); + await command.action(logger, { options: { force: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF@contoso.com, AdeleV@contoso.com' } }); assert(loggerLogSpy.notCalled); }); @@ -188,7 +188,7 @@ describe(commands.SITEDESIGN_RIGHTS_REVOKE, () => { return Promise.reject('File Not Found.'); }); - await assert.rejects(command.action(logger, { options: { confirm: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF' } } as any), new CommandError('File Not Found.')); + await assert.rejects(command.action(logger, { options: { force: true, siteDesignId: '0f27a016-d277-4bb4-b3c3-b5b040c9559b', principals: 'PattiF' } } as any), new CommandError('File Not Found.')); }); it('supports specifying id', () => { @@ -217,7 +217,7 @@ describe(commands.SITEDESIGN_RIGHTS_REVOKE, () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/spo/commands/sitedesign/sitedesign-rights-revoke.ts b/src/m365/spo/commands/sitedesign/sitedesign-rights-revoke.ts index d42bf59ab40..2ea5f79292d 100644 --- a/src/m365/spo/commands/sitedesign/sitedesign-rights-revoke.ts +++ b/src/m365/spo/commands/sitedesign/sitedesign-rights-revoke.ts @@ -14,7 +14,7 @@ interface CommandArgs { interface Options extends GlobalOptions { siteDesignId: string; principals: string; - confirm?: boolean; + force?: boolean; } class SpoSiteDesignRightsRevokeCommand extends SpoCommand { @@ -37,7 +37,7 @@ class SpoSiteDesignRightsRevokeCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: args.options.confirm || false + force: args.options.force || false }); }); } @@ -51,7 +51,7 @@ class SpoSiteDesignRightsRevokeCommand extends SpoCommand { option: '-p, --principals ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -88,13 +88,13 @@ class SpoSiteDesignRightsRevokeCommand extends SpoCommand { }; await request.post(requestOptions); - } + } catch (err: any) { this.handleRejectedODataJsonPromise(err); } }; - if (args.options.confirm) { + if (args.options.force) { await revokePermissions(); } else { @@ -104,7 +104,7 @@ class SpoSiteDesignRightsRevokeCommand extends SpoCommand { default: false, message: `Are you sure you want to revoke access to site design ${args.options.siteDesignId} from the specified users?` }); - + if (result.continue) { await revokePermissions(); } diff --git a/src/m365/spo/commands/sitedesign/sitedesign-task-remove.spec.ts b/src/m365/spo/commands/sitedesign/sitedesign-task-remove.spec.ts index de08a3cedfc..5a7f98a0ad9 100644 --- a/src/m365/spo/commands/sitedesign/sitedesign-task-remove.spec.ts +++ b/src/m365/spo/commands/sitedesign/sitedesign-task-remove.spec.ts @@ -91,7 +91,7 @@ describe(commands.SITEDESIGN_TASK_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { confirm: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } }); + await command.action(logger, { options: { force: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } }); assert(loggerLogSpy.notCalled); }); @@ -138,14 +138,14 @@ describe(commands.SITEDESIGN_TASK_REMOVE, () => { it('handles error correctly', async () => { sinon.stub(request, 'post').rejects(new Error('An error has occurred')); - await assert.rejects(command.action(logger, { options: { taskId: 'b2307a39-e878-458b-bc90-03bc578531d6', confirm: true } } as any), new CommandError('An error has occurred')); + await assert.rejects(command.action(logger, { options: { taskId: 'b2307a39-e878-458b-bc90-03bc578531d6', force: true } } as any), new CommandError('An error has occurred')); }); it('supports specifying confirmation flag', () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/spo/commands/sitedesign/sitedesign-task-remove.ts b/src/m365/spo/commands/sitedesign/sitedesign-task-remove.ts index 1c8de5c67f9..3d9d8778665 100644 --- a/src/m365/spo/commands/sitedesign/sitedesign-task-remove.ts +++ b/src/m365/spo/commands/sitedesign/sitedesign-task-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class SpoSiteDesignTaskRemoveCommand extends SpoCommand { @@ -36,7 +36,7 @@ class SpoSiteDesignTaskRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: args.options.confirm || false + force: args.options.force || false }); }); } @@ -47,7 +47,7 @@ class SpoSiteDesignTaskRemoveCommand extends SpoCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -65,7 +65,7 @@ class SpoSiteDesignTaskRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeSiteDesignTask(logger, args.options.id); } else { diff --git a/src/m365/spo/commands/sitescript/sitescript-remove.spec.ts b/src/m365/spo/commands/sitescript/sitescript-remove.spec.ts index db080de64bb..ebd1e7a4432 100644 --- a/src/m365/spo/commands/sitescript/sitescript-remove.spec.ts +++ b/src/m365/spo/commands/sitescript/sitescript-remove.spec.ts @@ -91,7 +91,7 @@ describe(commands.SITESCRIPT_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { confirm: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } }); + await command.action(logger, { options: { force: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } }); }); it('prompts before removing the specified site script when confirm option not passed', async () => { @@ -125,7 +125,7 @@ describe(commands.SITESCRIPT_REMOVE, () => { it('correctly handles error when site script not found', async () => { sinon.stub(request, 'post').rejects({ error: { 'odata.error': { message: { value: 'File Not Found.' } } } }); - await assert.rejects(command.action(logger, { options: { confirm: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } } as any), new CommandError('File Not Found.')); + await assert.rejects(command.action(logger, { options: { force: true, id: '0f27a016-d277-4bb4-b3c3-b5b040c9559b' } } as any), new CommandError('File Not Found.')); }); it('supports specifying id', () => { @@ -143,7 +143,7 @@ describe(commands.SITESCRIPT_REMOVE, () => { const options = command.options; let containsOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsOption = true; } }); diff --git a/src/m365/spo/commands/sitescript/sitescript-remove.ts b/src/m365/spo/commands/sitescript/sitescript-remove.ts index 3570d83eb38..4a049ab4861 100644 --- a/src/m365/spo/commands/sitescript/sitescript-remove.ts +++ b/src/m365/spo/commands/sitescript/sitescript-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; - confirm?: boolean; + force?: boolean; } class SpoSiteScriptRemoveCommand extends SpoCommand { @@ -36,7 +36,7 @@ class SpoSiteScriptRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: args.options.confirm || false + force: args.options.force || false }); }); } @@ -47,7 +47,7 @@ class SpoSiteScriptRemoveCommand extends SpoCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -65,7 +65,7 @@ class SpoSiteScriptRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeSiteScript(logger, args.options.id); } else { diff --git a/src/m365/spo/commands/storageentity/storageentity-remove.spec.ts b/src/m365/spo/commands/storageentity/storageentity-remove.spec.ts index b25055b9417..f1a4cafb534 100644 --- a/src/m365/spo/commands/storageentity/storageentity-remove.spec.ts +++ b/src/m365/spo/commands/storageentity/storageentity-remove.spec.ts @@ -89,7 +89,7 @@ describe(commands.STORAGEENTITY_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { key: 'existingproperty', confirm: true, appCatalogUrl: 'https://contoso.sharepoint.com/sites/appcatalog' } }); + await command.action(logger, { options: { key: 'existingproperty', force: true, appCatalogUrl: 'https://contoso.sharepoint.com/sites/appcatalog' } }); assert.strictEqual(postStub.lastCall.args[0].url, 'https://contoso-admin.sharepoint.com/_vti_bin/client.svc/ProcessQuery'); assert.strictEqual(postStub.lastCall.args[0].headers['X-RequestDigest'], 'ABC'); assert.strictEqual(postStub.lastCall.args[0].data, `existingpropertyhttps://contoso.sharepoint.com/sites/appcatalog`); @@ -173,7 +173,7 @@ describe(commands.STORAGEENTITY_REMOVE, () => { const options = command.options; let containsConfirmOption = false; options.forEach(o => { - if (o.option.indexOf('--confirm') > -1) { + if (o.option.indexOf('--force') > -1) { containsConfirmOption = true; } }); diff --git a/src/m365/spo/commands/storageentity/storageentity-remove.ts b/src/m365/spo/commands/storageentity/storageentity-remove.ts index 0c639523f05..98d1f047f68 100644 --- a/src/m365/spo/commands/storageentity/storageentity-remove.ts +++ b/src/m365/spo/commands/storageentity/storageentity-remove.ts @@ -16,7 +16,7 @@ interface CommandArgs { interface Options extends GlobalOptions { appCatalogUrl: string; key: string; - confirm?: boolean; + force?: boolean; } class SpoStorageEntityRemoveCommand extends SpoCommand { @@ -39,7 +39,7 @@ class SpoStorageEntityRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -53,7 +53,7 @@ class SpoStorageEntityRemoveCommand extends SpoCommand { option: '-k, --key ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -65,7 +65,7 @@ class SpoStorageEntityRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeTenantProperty(logger, args); } else { diff --git a/src/m365/spo/commands/tenant/tenant-appcatalog-add.ts b/src/m365/spo/commands/tenant/tenant-appcatalog-add.ts index 0419a36ce63..3889814d850 100644 --- a/src/m365/spo/commands/tenant/tenant-appcatalog-add.ts +++ b/src/m365/spo/commands/tenant/tenant-appcatalog-add.ts @@ -148,7 +148,6 @@ class SpoTenantAppCatalogAddCommand extends SpoCommand { debug: this.debug }; - await Cli.executeCommand(spoSiteRemoveCommand as Command, { options: { ...siteRemoveOptions, _: [] } }); } catch (err: any) { diff --git a/src/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.spec.ts b/src/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.spec.ts index 8f1e5ee712d..e969c79a2ae 100644 --- a/src/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.spec.ts +++ b/src/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.spec.ts @@ -222,7 +222,7 @@ describe(commands.TENANT_APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -241,7 +241,7 @@ describe(commands.TENANT_APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -310,7 +310,7 @@ describe(commands.TENANT_APPLICATIONCUSTOMIZER_REMOVE, () => { await command.action(logger, { options: { title: title, - confirm: true + force: true } }); assert(postSpy.called); @@ -409,7 +409,7 @@ describe(commands.TENANT_APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -437,7 +437,7 @@ describe(commands.TENANT_APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects(command.action(logger, { options: { clientSideComponentId: clientSideComponentId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -459,7 +459,7 @@ describe(commands.TENANT_APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -482,7 +482,7 @@ describe(commands.TENANT_APPLICATIONCUSTOMIZER_REMOVE, () => { await assert.rejects(command.action(logger, { options: { clientSideComponentId: clientSideComponentId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.ts b/src/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.ts index 183f3c2cc8b..99128afba3e 100644 --- a/src/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.ts +++ b/src/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { title?: string; id?: string; clientSideComponentId?: string; - confirm?: boolean; + force?: boolean; } class SpoTenantApplicationCustomizerRemoveCommand extends SpoCommand { @@ -46,7 +46,7 @@ class SpoTenantApplicationCustomizerRemoveCommand extends SpoCommand { title: typeof args.options.title !== 'undefined', id: typeof args.options.id !== 'undefined', clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -63,7 +63,7 @@ class SpoTenantApplicationCustomizerRemoveCommand extends SpoCommand { option: '-c, --clientSideComponentId [clientSideComponentId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -94,7 +94,7 @@ class SpoTenantApplicationCustomizerRemoveCommand extends SpoCommand { public async commandAction(logger: Logger, args: CommandArgs): Promise { try { - if (args.options.confirm) { + if (args.options.force) { return await this.removeTenantApplicationCustomizer(logger, args); } diff --git a/src/m365/spo/commands/tenant/tenant-commandset-remove.spec.ts b/src/m365/spo/commands/tenant/tenant-commandset-remove.spec.ts index ddd6a503a32..43411648c8d 100644 --- a/src/m365/spo/commands/tenant/tenant-commandset-remove.spec.ts +++ b/src/m365/spo/commands/tenant/tenant-commandset-remove.spec.ts @@ -221,7 +221,7 @@ describe(commands.TENANT_COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -240,7 +240,7 @@ describe(commands.TENANT_COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -309,7 +309,7 @@ describe(commands.TENANT_COMMANDSET_REMOVE, () => { await command.action(logger, { options: { title: title, - confirm: true + force: true } }); assert(postSpy.called); @@ -408,7 +408,7 @@ describe(commands.TENANT_COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -436,7 +436,7 @@ describe(commands.TENANT_COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { clientSideComponentId: clientSideComponentId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -458,7 +458,7 @@ describe(commands.TENANT_COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { title: title, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -481,7 +481,7 @@ describe(commands.TENANT_COMMANDSET_REMOVE, () => { await assert.rejects(command.action(logger, { options: { clientSideComponentId: clientSideComponentId, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/spo/commands/tenant/tenant-commandset-remove.ts b/src/m365/spo/commands/tenant/tenant-commandset-remove.ts index 3527d7b5f47..b8929760dbc 100644 --- a/src/m365/spo/commands/tenant/tenant-commandset-remove.ts +++ b/src/m365/spo/commands/tenant/tenant-commandset-remove.ts @@ -19,7 +19,7 @@ interface Options extends GlobalOptions { title?: string; id?: string; clientSideComponentId?: string; - confirm?: boolean; + force?: boolean; } class SpoTenantCommandSetRemoveCommand extends SpoCommand { @@ -46,7 +46,7 @@ class SpoTenantCommandSetRemoveCommand extends SpoCommand { title: typeof args.options.title !== 'undefined', id: typeof args.options.id !== 'undefined', clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -63,7 +63,7 @@ class SpoTenantCommandSetRemoveCommand extends SpoCommand { option: '-c, --clientSideComponentId [clientSideComponentId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -94,7 +94,7 @@ class SpoTenantCommandSetRemoveCommand extends SpoCommand { public async commandAction(logger: Logger, args: CommandArgs): Promise { try { - if (args.options.confirm) { + if (args.options.force) { return await this.removeTenantCommandSet(logger, args); } diff --git a/src/m365/spo/commands/tenant/tenant-recyclebinitem-remove.spec.ts b/src/m365/spo/commands/tenant/tenant-recyclebinitem-remove.spec.ts index bf3818c304c..fc6cfe37dbd 100644 --- a/src/m365/spo/commands/tenant/tenant-recyclebinitem-remove.spec.ts +++ b/src/m365/spo/commands/tenant/tenant-recyclebinitem-remove.spec.ts @@ -144,7 +144,7 @@ describe(commands.TENANT_RECYCLEBINITEM_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', confirm: true, debug: true } }); + await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', force: true, debug: true } }); sinonUtil.restore([ request.post ]); @@ -172,7 +172,7 @@ describe(commands.TENANT_RECYCLEBINITEM_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', confirm: true, verbose: true } }); + await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', force: true, verbose: true } }); sinonUtil.restore([ request.post ]); @@ -200,7 +200,7 @@ describe(commands.TENANT_RECYCLEBINITEM_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', confirm: true, wait: true } }); + await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', force: true, wait: true } }); sinonUtil.restore([ request.post ]); @@ -244,7 +244,7 @@ describe(commands.TENANT_RECYCLEBINITEM_REMOVE, () => { return {} as any; }); - await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', confirm: true, wait: true } }); + await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', force: true, wait: true } }); sinonUtil.restore([ request.post ]); @@ -288,7 +288,7 @@ describe(commands.TENANT_RECYCLEBINITEM_REMOVE, () => { return {} as any; }); - await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', confirm: true, wait: true, debug: true } }); + await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', force: true, wait: true, debug: true } }); sinonUtil.restore([ request.post ]); @@ -332,7 +332,7 @@ describe(commands.TENANT_RECYCLEBINITEM_REMOVE, () => { return {} as any; }); - await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', confirm: true, wait: true, verbose: true } }); + await command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', force: true, wait: true, verbose: true } }); sinonUtil.restore([ request.post ]); @@ -358,6 +358,6 @@ describe(commands.TENANT_RECYCLEBINITEM_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', confirm: true, wait: true } } as any), new CommandError('Unable to find the deleted site: https:\u002f\u002fcontoso.sharepoint.com\u002fsites\u002fhr.')); + await assert.rejects(command.action(logger, { options: { siteUrl: 'https://contoso.sharepoint.com/sites/hr', force: true, wait: true } } as any), new CommandError('Unable to find the deleted site: https:\u002f\u002fcontoso.sharepoint.com\u002fsites\u002fhr.')); }); }); diff --git a/src/m365/spo/commands/tenant/tenant-recyclebinitem-remove.ts b/src/m365/spo/commands/tenant/tenant-recyclebinitem-remove.ts index 1f5da137ded..3d49d2a05cf 100644 --- a/src/m365/spo/commands/tenant/tenant-recyclebinitem-remove.ts +++ b/src/m365/spo/commands/tenant/tenant-recyclebinitem-remove.ts @@ -16,7 +16,7 @@ interface CommandArgs { interface Options extends GlobalOptions { siteUrl: string; wait?: boolean; - confirm?: boolean; + force?: boolean; } class SpoTenantRecycleBinItemRemoveCommand extends SpoCommand { @@ -42,7 +42,7 @@ class SpoTenantRecycleBinItemRemoveCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { wait: typeof args.options.wait !== 'undefined', - confirm: typeof args.options.confirm !== 'undefined' + force: typeof args.options.force !== 'undefined' }); }); } @@ -56,7 +56,7 @@ class SpoTenantRecycleBinItemRemoveCommand extends SpoCommand { option: '--wait' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -68,7 +68,7 @@ class SpoTenantRecycleBinItemRemoveCommand extends SpoCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeDeletedSite(logger, args); } else { diff --git a/src/m365/spo/commands/theme/theme-remove.spec.ts b/src/m365/spo/commands/theme/theme-remove.spec.ts index 65589f9bb9c..d0876ca655d 100644 --- a/src/m365/spo/commands/theme/theme-remove.spec.ts +++ b/src/m365/spo/commands/theme/theme-remove.spec.ts @@ -93,7 +93,7 @@ describe(commands.THEME_REMOVE, () => { await command.action(logger, { options: { name: 'Contoso', - confirm: true + force: true } }); assert.strictEqual(postStub.lastCall.args[0].url, 'https://contoso-admin.sharepoint.com/_api/thememanager/DeleteTenantTheme'); @@ -116,7 +116,7 @@ describe(commands.THEME_REMOVE, () => { options: { debug: true, name: 'Contoso', - confirm: true + force: true } }); assert.strictEqual(postStub.lastCall.args[0].url, 'https://contoso-admin.sharepoint.com/_api/thememanager/DeleteTenantTheme'); @@ -169,7 +169,7 @@ describe(commands.THEME_REMOVE, () => { options: { debug: true, name: 'Contoso', - confirm: true + force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/spo/commands/theme/theme-remove.ts b/src/m365/spo/commands/theme/theme-remove.ts index 298f495bf86..076fd3932d6 100644 --- a/src/m365/spo/commands/theme/theme-remove.ts +++ b/src/m365/spo/commands/theme/theme-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { name: string; - confirm?: boolean; + force?: boolean; } class SpoThemeRemoveCommand extends SpoCommand { @@ -34,7 +34,7 @@ class SpoThemeRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -45,7 +45,7 @@ class SpoThemeRemoveCommand extends SpoCommand { option: '-n, --name ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -70,13 +70,13 @@ class SpoThemeRemoveCommand extends SpoCommand { }; await request.post(requestOptions); - } + } catch (err: any) { this.handleRejectedODataJsonPromise(err); } }; - if (args.options.confirm) { + if (args.options.force) { await removeTheme(); } else { @@ -86,7 +86,7 @@ class SpoThemeRemoveCommand extends SpoCommand { default: false, message: `Are you sure you want to remove the theme` }); - + if (result.continue) { await removeTheme(); } diff --git a/src/m365/spo/commands/user/user-remove.spec.ts b/src/m365/spo/commands/user/user-remove.spec.ts index 2bebd228472..95f10c706a2 100644 --- a/src/m365/spo/commands/user/user-remove.spec.ts +++ b/src/m365/spo/commands/user/user-remove.spec.ts @@ -152,7 +152,7 @@ describe(commands.USER_REMOVE, () => { options: { webUrl: "https://contoso.sharepoint.com/subsite", id: 10, - confirm: true + force: true } }); let correctRequestIssued = false; @@ -178,7 +178,7 @@ describe(commands.USER_REMOVE, () => { options: { webUrl: "https://contoso.sharepoint.com/subsite", loginName: "i:0#.f|membership|parker@tenant.onmicrosoft.com", - confirm: true + force: true } }); let correctRequestIssued = false; @@ -263,7 +263,7 @@ describe(commands.USER_REMOVE, () => { verbose: true, webUrl: "https://contoso.sharepoint.com/subsite", id: 10, - confirm: true + force: true } }); let correctRequestIssued = false; @@ -290,7 +290,7 @@ describe(commands.USER_REMOVE, () => { debug: true, webUrl: "https://contoso.sharepoint.com/subsite", id: 10, - confirm: true + force: true } }); let correctRequestIssued = false; @@ -316,7 +316,7 @@ describe(commands.USER_REMOVE, () => { options: { webUrl: "https://contoso.sharepoint.com/subsite", id: 10, - confirm: true + force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/spo/commands/user/user-remove.ts b/src/m365/spo/commands/user/user-remove.ts index 18bb5e85008..7bb35b3d431 100644 --- a/src/m365/spo/commands/user/user-remove.ts +++ b/src/m365/spo/commands/user/user-remove.ts @@ -15,7 +15,7 @@ interface Options extends GlobalOptions { webUrl: string; id?: string; loginName?: string; - confirm: boolean; + force: boolean; } class SpoUserRemoveCommand extends SpoCommand { @@ -41,7 +41,7 @@ class SpoUserRemoveCommand extends SpoCommand { Object.assign(this.telemetryProperties, { id: (!(!args.options.id)).toString(), loginName: (!(!args.options.loginName)).toString(), - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -58,7 +58,7 @@ class SpoUserRemoveCommand extends SpoCommand { option: '--loginName [loginName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -107,7 +107,7 @@ class SpoUserRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeUser(); } else { diff --git a/src/m365/spo/commands/web/web-remove.spec.ts b/src/m365/spo/commands/web/web-remove.spec.ts index 1409777a9fe..eb2bc7b8832 100644 --- a/src/m365/spo/commands/web/web-remove.spec.ts +++ b/src/m365/spo/commands/web/web-remove.spec.ts @@ -120,7 +120,7 @@ describe(commands.WEB_REMOVE, () => { await command.action(logger, { options: { url: "https://contoso.sharepoint.com/subsite", - confirm: true + force: true } }); let correctRequestIssued = false; @@ -180,7 +180,7 @@ describe(commands.WEB_REMOVE, () => { options: { verbose: true, url: "https://contoso.sharepoint.com/subsite", - confirm: true + force: true } }); let correctRequestIssued = false; @@ -208,7 +208,7 @@ describe(commands.WEB_REMOVE, () => { options: { debug: true, url: "https://contoso.sharepoint.com/subsite", - confirm: true + force: true } }); let correctRequestIssued = false; @@ -235,7 +235,7 @@ describe(commands.WEB_REMOVE, () => { await assert.rejects(command.action(logger, { options: { url: "https://contoso.sharepoint.com/subsite", - confirm: true + force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/spo/commands/web/web-remove.ts b/src/m365/spo/commands/web/web-remove.ts index f9facfb434a..971f7b64a9a 100644 --- a/src/m365/spo/commands/web/web-remove.ts +++ b/src/m365/spo/commands/web/web-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { url: string; - confirm?: boolean; + force?: boolean; } class SpoWebRemoveCommand extends SpoCommand { @@ -35,7 +35,7 @@ class SpoWebRemoveCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -46,7 +46,7 @@ class SpoWebRemoveCommand extends SpoCommand { option: '-u, --url ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -74,13 +74,13 @@ class SpoWebRemoveCommand extends SpoCommand { try { await request.post(requestOptions); - } + } catch (err: any) { this.handleRejectedODataJsonPromise(err); } }; - if (args.options.confirm) { + if (args.options.force) { await removeWeb(); } else { @@ -90,7 +90,7 @@ class SpoWebRemoveCommand extends SpoCommand { default: false, message: `Are you sure you want to remove the subsite ${args.options.url}` }); - + if (result.continue) { await removeWeb(); } diff --git a/src/m365/spo/commands/web/web-roleassignment-remove.spec.ts b/src/m365/spo/commands/web/web-roleassignment-remove.spec.ts index feed2ed5ce1..65f4cbf0b53 100644 --- a/src/m365/spo/commands/web/web-roleassignment-remove.spec.ts +++ b/src/m365/spo/commands/web/web-roleassignment-remove.spec.ts @@ -106,7 +106,7 @@ describe(commands.WEB_ROLEASSIGNMENT_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', principalId: 11, - confirm: true + force: true } }); }); @@ -135,7 +135,7 @@ describe(commands.WEB_ROLEASSIGNMENT_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', upn: 'someaccount@tenant.onmicrosoft.com', - confirm: true + force: true } }); }); @@ -163,7 +163,7 @@ describe(commands.WEB_ROLEASSIGNMENT_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', upn: 'someaccount@tenant.onmicrosoft.com', - confirm: true + force: true } } as any), new CommandError(error)); }); @@ -192,7 +192,7 @@ describe(commands.WEB_ROLEASSIGNMENT_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', groupName: 'someGroup', - confirm: true + force: true } }); }); @@ -220,7 +220,7 @@ describe(commands.WEB_ROLEASSIGNMENT_REMOVE, () => { debug: true, webUrl: 'https://contoso.sharepoint.com', groupName: 'someGroup', - confirm: true + force: true } } as any), new CommandError(error)); }); diff --git a/src/m365/spo/commands/web/web-roleassignment-remove.ts b/src/m365/spo/commands/web/web-roleassignment-remove.ts index c2ce4735afb..c851c273445 100644 --- a/src/m365/spo/commands/web/web-roleassignment-remove.ts +++ b/src/m365/spo/commands/web/web-roleassignment-remove.ts @@ -21,7 +21,7 @@ interface Options extends GlobalOptions { principalId?: number; upn?: string; groupName?: string; - confirm?: boolean; + force?: boolean; } class SpoWebRoleAssignmentRemoveCommand extends SpoCommand { @@ -48,7 +48,7 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand { principalId: typeof args.options.principalId !== 'undefined', upn: typeof args.options.upn !== 'undefined', groupName: typeof args.options.groupName !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -68,7 +68,7 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand { option: '--groupName [groupName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -120,7 +120,7 @@ class SpoWebRoleAssignmentRemoveCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeRoleAssignment(); } else { diff --git a/src/m365/spo/commands/web/web-roleinheritance-break.spec.ts b/src/m365/spo/commands/web/web-roleinheritance-break.spec.ts index 2b2a7cb1d13..adb5069cb2e 100644 --- a/src/m365/spo/commands/web/web-roleinheritance-break.spec.ts +++ b/src/m365/spo/commands/web/web-roleinheritance-break.spec.ts @@ -152,7 +152,7 @@ describe(commands.WEB_ROLEINHERITANCE_BREAK, () => { verbose: true, webUrl: 'https://contoso.sharepoint.com/subsite', clearExistingPermissions: true, - confirm: true + force: true } }); }); @@ -164,7 +164,7 @@ describe(commands.WEB_ROLEINHERITANCE_BREAK, () => { await assert.rejects(command.action(logger, { options: { webUrl: 'https://contoso.sharepoint.com/subsite', - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/spo/commands/web/web-roleinheritance-break.ts b/src/m365/spo/commands/web/web-roleinheritance-break.ts index 9b467615904..81a861271ad 100644 --- a/src/m365/spo/commands/web/web-roleinheritance-break.ts +++ b/src/m365/spo/commands/web/web-roleinheritance-break.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { webUrl: string; clearExistingPermissions?: boolean; - confirm?: boolean; + force?: boolean; } class SpoWebRoleInheritanceBreakCommand extends SpoCommand { @@ -37,7 +37,7 @@ class SpoWebRoleInheritanceBreakCommand extends SpoCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { clearExistingPermissions: !!args.options.clearExistingPermissions, - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -51,7 +51,7 @@ class SpoWebRoleInheritanceBreakCommand extends SpoCommand { option: '-c, --clearExistingPermissions' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -92,7 +92,7 @@ class SpoWebRoleInheritanceBreakCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await breakroleInheritance(); } else { diff --git a/src/m365/spo/commands/web/web-roleinheritance-reset.spec.ts b/src/m365/spo/commands/web/web-roleinheritance-reset.spec.ts index 219b593b8e1..14a146b9f50 100644 --- a/src/m365/spo/commands/web/web-roleinheritance-reset.spec.ts +++ b/src/m365/spo/commands/web/web-roleinheritance-reset.spec.ts @@ -101,7 +101,7 @@ describe(commands.WEB_ROLEINHERITANCE_RESET, () => { options: { debug: true, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } }); }); @@ -120,7 +120,7 @@ describe(commands.WEB_ROLEINHERITANCE_RESET, () => { options: { debug: true, webUrl: 'https://contoso.sharepoint.com', - confirm: true + force: true } } as any), new CommandError(err)); }); diff --git a/src/m365/spo/commands/web/web-roleinheritance-reset.ts b/src/m365/spo/commands/web/web-roleinheritance-reset.ts index 7f6e20e0f73..2d9faf84468 100644 --- a/src/m365/spo/commands/web/web-roleinheritance-reset.ts +++ b/src/m365/spo/commands/web/web-roleinheritance-reset.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { webUrl: string; - confirm?: boolean; + force?: boolean; } class SpoWebRoleInheritanceResetCommand extends SpoCommand { @@ -35,7 +35,7 @@ class SpoWebRoleInheritanceResetCommand extends SpoCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -46,7 +46,7 @@ class SpoWebRoleInheritanceResetCommand extends SpoCommand { option: '-u, --webUrl ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -83,7 +83,7 @@ class SpoWebRoleInheritanceResetCommand extends SpoCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await resetWebRoleInheritance(); } else { diff --git a/src/m365/teams/commands/app/app-remove.spec.ts b/src/m365/teams/commands/app/app-remove.spec.ts index 081e94d829f..8f3697bab18 100644 --- a/src/m365/teams/commands/app/app-remove.spec.ts +++ b/src/m365/teams/commands/app/app-remove.spec.ts @@ -92,7 +92,7 @@ describe(commands.APP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: `e3e29acb-8c79-412b-b746-e6c39ff4cd22`, confirm: true } }); + await command.action(logger, { options: { id: `e3e29acb-8c79-412b-b746-e6c39ff4cd22`, force: true } }); assert(removeTeamsAppCalled); }); @@ -107,7 +107,7 @@ describe(commands.APP_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { debug: true, filePath: 'teamsapp.zip', id: `e3e29acb-8c79-412b-b746-e6c39ff4cd22`, confirm: true } }); + await command.action(logger, { options: { debug: true, filePath: 'teamsapp.zip', id: `e3e29acb-8c79-412b-b746-e6c39ff4cd22`, force: true } }); assert(removeTeamsAppCalled); }); @@ -150,7 +150,7 @@ describe(commands.APP_REMOVE, () => { await assert.rejects(command.action(logger, { options: { filePath: 'teamsapp.zip', - id: `e3e29acb-8c79-412b-b746-e6c39ff4cd22`, confirm: true + id: `e3e29acb-8c79-412b-b746-e6c39ff4cd22`, force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/teams/commands/app/app-remove.ts b/src/m365/teams/commands/app/app-remove.ts index e2406616509..f7e41407651 100644 --- a/src/m365/teams/commands/app/app-remove.ts +++ b/src/m365/teams/commands/app/app-remove.ts @@ -11,7 +11,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; id: string; } @@ -35,7 +35,7 @@ class TeamsAppRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -46,7 +46,7 @@ class TeamsAppRemoveCommand extends GraphCommand { option: '-i, --id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -86,7 +86,7 @@ class TeamsAppRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeApp(); } else { diff --git a/src/m365/teams/commands/app/app-uninstall.spec.ts b/src/m365/teams/commands/app/app-uninstall.spec.ts index fb2fa61656e..fdec111be91 100644 --- a/src/m365/teams/commands/app/app-uninstall.spec.ts +++ b/src/m365/teams/commands/app/app-uninstall.spec.ts @@ -88,7 +88,7 @@ describe(commands.APP_UNINSTALL, () => { options: { teamId: 'c527a470-a882-481c-981c-ee6efaba85c7', id: 'YzUyN2E0NzAtYTg4Mi00ODFjLTk4MWMtZWU2ZWZhYmE4NWM3IyM0ZDFlYTA0Ny1mMTk2LTQ1MGQtYjJlOS0wZDI4NTViYTA1YTY=', - confirm: true, + force: true, verbose: true } }); @@ -143,7 +143,7 @@ describe(commands.APP_UNINSTALL, () => { options: { teamId: 'c527a470-a882-481c-981c-ee6efaba85c7', id: 'YzUyN2E0NzAtYTg4Mi00ODFjLTk4MWMtZWU2ZWZhYmE4NWM3IyM0ZDFlYTA0Ny1mMTk2LTQ1MGQtYjJlOS0wZDI4NTViYTA1YTY=', - confirm: true + force: true } } as any), new CommandError('An error has occurred')); }); @@ -153,7 +153,7 @@ describe(commands.APP_UNINSTALL, () => { options: { teamId: 'c527a470-a882-481c-981c-ee6efaba85c7', id: 'YzUyN2E0NzAtYTg4Mi00ODFjLTk4MWMtZWU2ZWZhYmE4NWM3IyM0ZDFlYTA0Ny1mMTk2LTQ1MGQtYjJlOS0wZDI4NTViYTA1YTY=', - confirm: true + force: true } }, commandInfo); assert.strictEqual(actual, true); diff --git a/src/m365/teams/commands/app/app-uninstall.ts b/src/m365/teams/commands/app/app-uninstall.ts index 46fd614d0f0..cf40d35788b 100644 --- a/src/m365/teams/commands/app/app-uninstall.ts +++ b/src/m365/teams/commands/app/app-uninstall.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; teamId: string; - confirm?: boolean; + force?: boolean; } class TeamsAppUninstallCommand extends GraphCommand { @@ -36,7 +36,7 @@ class TeamsAppUninstallCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: args.options.confirm || false + force: args.options.force || false }); }); } @@ -50,7 +50,7 @@ class TeamsAppUninstallCommand extends GraphCommand { option: '--teamId ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -88,7 +88,7 @@ class TeamsAppUninstallCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await uninstallApp(); } else { diff --git a/src/m365/teams/commands/cache/cache-remove.spec.ts b/src/m365/teams/commands/cache/cache-remove.spec.ts index 56b25405d5e..542c2871158 100644 --- a/src/m365/teams/commands/cache/cache-remove.spec.ts +++ b/src/m365/teams/commands/cache/cache-remove.spec.ts @@ -139,7 +139,7 @@ describe(commands.CACHE_REMOVE, () => { } throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { confirm: true } } as any), new CommandError('random error')); + await assert.rejects(command.action(logger, { options: { force: true } } as any), new CommandError('random error')); }); it('fails to remove teams cache when exec fails randomly when removing cache folder', async () => { @@ -157,7 +157,7 @@ describe(commands.CACHE_REMOVE, () => { } throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { confirm: true } } as any), new CommandError('random error')); + await assert.rejects(command.action(logger, { options: { force: true } } as any), new CommandError('random error')); }); it('removes Teams cache from macOs platform without prompting.', async () => { @@ -169,7 +169,7 @@ describe(commands.CACHE_REMOVE, () => { await command.action(logger, { options: { - confirm: true, + force: true, verbose: true } }); @@ -193,7 +193,7 @@ describe(commands.CACHE_REMOVE, () => { await command.action(logger, { options: { - confirm: true, + force: true, verbose: true } }); @@ -216,7 +216,7 @@ describe(commands.CACHE_REMOVE, () => { sinon.stub(fs, 'existsSync').returns(true); await command.action(logger, { options: { - confirm: true, + force: true, verbose: true } }); diff --git a/src/m365/teams/commands/cache/cache-remove.ts b/src/m365/teams/commands/cache/cache-remove.ts index 48da4466a83..2b37b6d889b 100644 --- a/src/m365/teams/commands/cache/cache-remove.ts +++ b/src/m365/teams/commands/cache/cache-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { } interface Options extends GlobalOptions { - confirm?: boolean; + force?: boolean; } interface Win32Process { @@ -40,7 +40,7 @@ class TeamsCacheRemoveCommand extends AnonymousCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -48,7 +48,7 @@ class TeamsCacheRemoveCommand extends AnonymousCommand { #initOptions(): void { this.options.unshift( { - option: '--confirm' + option: '-f, --force' } ); } @@ -71,7 +71,7 @@ class TeamsCacheRemoveCommand extends AnonymousCommand { public async commandAction(logger: Logger, args: CommandArgs): Promise { try { - if (args.options.confirm) { + if (args.options.force) { await this.clearTeamsCache(logger); } else { diff --git a/src/m365/teams/commands/channel/channel-member-remove.spec.ts b/src/m365/teams/commands/channel/channel-member-remove.spec.ts index 685f054eaf5..a700cc55dd0 100644 --- a/src/m365/teams/commands/channel/channel-member-remove.spec.ts +++ b/src/m365/teams/commands/channel/channel-member-remove.spec.ts @@ -149,7 +149,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamName: 'Team Name', channelId: '19:00000000000000000000000000000000@thread.skype', id: '00000', - confirm: true, + force: true, verbose: true } } as any), new CommandError('The specified team does not exist in the Microsoft Teams')); @@ -177,7 +177,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamName: 'Team Name', channelId: '19:00000000000000000000000000000000@thread.skype', id: '00000', - confirm: true, + force: true, verbose: true } }); @@ -200,7 +200,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelName: 'Channel Name', id: '00000', - confirm: true, + force: true, verbose: true } } as any), new CommandError('The specified channel does not exist in the Microsoft Teams team')); @@ -228,7 +228,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelName: 'Other Channel', id: '00000', - confirm: true, + force: true, verbose: true } } as any), new CommandError('The specified channel is not a private channel')); @@ -263,7 +263,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelName: 'Channel Name', id: '00000', - confirm: true, + force: true, verbose: true } }); @@ -293,7 +293,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelId: '19:00000000000000000000000000000000@thread.skype', userId: '00000000-0000-0000-0000-000000000000', - confirm: true, + force: true, verbose: true } } as any), new CommandError('The specified member does not exist in the Microsoft Teams channel')); @@ -321,7 +321,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelId: '19:00000000000000000000000000000000@thread.skype', userId: '00000000-0000-0000-0000-000000000000', - confirm: true, + force: true, verbose: true } } as any), new CommandError('The specified member does not exist in the Microsoft Teams channel')); @@ -350,7 +350,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelId: '19:00000000000000000000000000000000@thread.skype', userName: 'user@domainname.com', - confirm: true, + force: true, verbose: true } } as any), new CommandError('The specified member does not exist in the Microsoft Teams channel')); @@ -378,7 +378,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelId: '19:00000000000000000000000000000000@thread.skype', userName: 'user@domainname.com', - confirm: true, + force: true, verbose: true } } as any), new CommandError('The specified member does not exist in the Microsoft Teams channel')); @@ -412,7 +412,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelId: '19:00000000000000000000000000000000@thread.skype', userName: 'user@domainname.com', - confirm: true, + force: true, verbose: true } } as any), new CommandError('Multiple Microsoft Teams channel members with name user@domainname.com found: 00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002')); @@ -448,7 +448,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelId: '19:00000000000000000000000000000000@thread.skype', userId: '00000000-0000-0000-0000-000000000000', - confirm: true, + force: true, verbose: true } }); @@ -505,7 +505,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { teamId: '00000000-0000-0000-0000-000000000000', channelId: '19:00000000000000000000000000000000@thread.skype', id: '00000', - confirm: true, + force: true, verbose: true } }); @@ -585,7 +585,7 @@ describe(commands.CHANNEL_MEMBER_REMOVE, () => { await assert.rejects(command.action(logger, { options: { - confirm: true, + force: true, teamId: '00000000-0000-0000-0000-000000000000', verbose: true } diff --git a/src/m365/teams/commands/channel/channel-member-remove.ts b/src/m365/teams/commands/channel/channel-member-remove.ts index fd524b00dfe..5dea85cec46 100644 --- a/src/m365/teams/commands/channel/channel-member-remove.ts +++ b/src/m365/teams/commands/channel/channel-member-remove.ts @@ -30,7 +30,7 @@ interface Options extends GlobalOptions { userName?: string; userId?: string; id?: string; - confirm?: boolean; + force?: boolean; } class TeamsChannelMemberRemoveCommand extends GraphCommand { @@ -64,7 +64,7 @@ class TeamsChannelMemberRemoveCommand extends GraphCommand { userName: typeof args.options.userName !== 'undefined', userId: typeof args.options.userId !== 'undefined', id: typeof args.options.id !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -93,7 +93,7 @@ class TeamsChannelMemberRemoveCommand extends GraphCommand { option: '--id [id]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -139,7 +139,7 @@ class TeamsChannelMemberRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeMember(); } else { diff --git a/src/m365/teams/commands/channel/channel-remove.spec.ts b/src/m365/teams/commands/channel/channel-remove.spec.ts index edf61ffd796..e98fb4e87dd 100644 --- a/src/m365/teams/commands/channel/channel-remove.spec.ts +++ b/src/m365/teams/commands/channel/channel-remove.spec.ts @@ -129,7 +129,7 @@ describe(commands.CHANNEL_REMOVE, () => { debug: true, teamId: teamId, name: name, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -189,7 +189,7 @@ describe(commands.CHANNEL_REMOVE, () => { options: { id: id, teamName: teamName, - confirm: true + force: true } }), new CommandError(errorMessage)); }); @@ -201,7 +201,7 @@ describe(commands.CHANNEL_REMOVE, () => { options: { id: id, teamId: teamId, - confirm: true + force: true } }); }); @@ -349,7 +349,7 @@ describe(commands.CHANNEL_REMOVE, () => { debug: true, name: name, teamName: teamName, - confirm: true + force: true } }); }); @@ -373,7 +373,7 @@ describe(commands.CHANNEL_REMOVE, () => { debug: true, id: id, teamId: teamId, - confirm: true + force: true } }), new CommandError(error.error.message)); }); diff --git a/src/m365/teams/commands/channel/channel-remove.ts b/src/m365/teams/commands/channel/channel-remove.ts index 88707116c5b..2be2430ab19 100644 --- a/src/m365/teams/commands/channel/channel-remove.ts +++ b/src/m365/teams/commands/channel/channel-remove.ts @@ -22,7 +22,7 @@ interface Options extends GlobalOptions { name?: string; teamId?: string; teamName?: string; - confirm?: boolean; + force?: boolean; } class TeamsChannelRemoveCommand extends GraphCommand { @@ -52,7 +52,7 @@ class TeamsChannelRemoveCommand extends GraphCommand { name: typeof args.options.name !== 'undefined', teamId: typeof args.options.teamId !== 'undefined', teamName: typeof args.options.teamName !== 'undefined', - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -72,7 +72,7 @@ class TeamsChannelRemoveCommand extends GraphCommand { option: '-n, --name [name]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -125,7 +125,7 @@ class TeamsChannelRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeChannel(); } else { diff --git a/src/m365/teams/commands/channel/channel-set.spec.ts b/src/m365/teams/commands/channel/channel-set.spec.ts index ad7a94a172d..893c115b42e 100644 --- a/src/m365/teams/commands/channel/channel-set.spec.ts +++ b/src/m365/teams/commands/channel/channel-set.spec.ts @@ -239,7 +239,7 @@ describe(commands.CHANNEL_SET, () => { teamName: teamName, newName: newName, description: description, - confirm: true + force: true } }), new CommandError(errorMessage)); }); diff --git a/src/m365/teams/commands/chat/chat-member-remove.spec.ts b/src/m365/teams/commands/chat/chat-member-remove.spec.ts index 9a222e0040c..2af2c361c70 100644 --- a/src/m365/teams/commands/chat/chat-member-remove.spec.ts +++ b/src/m365/teams/commands/chat/chat-member-remove.spec.ts @@ -111,7 +111,7 @@ describe(commands.CHAT_MEMBER_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { chatId: chatId, userId: userId, confirm: true, verbose: true } }); + await command.action(logger, { options: { chatId: chatId, userId: userId, force: true, verbose: true } }); assert(deleteStub.called); }); @@ -124,7 +124,7 @@ describe(commands.CHAT_MEMBER_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { chatId: chatId, id: chatMemberId, confirm: true, verbose: true } }); + await command.action(logger, { options: { chatId: chatId, id: chatMemberId, force: true, verbose: true } }); assert(deleteStub.called); }); @@ -161,7 +161,7 @@ describe(commands.CHAT_MEMBER_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { chatId: chatId, userName: userPrincipalName, confirm: true, verbose: true } }), + await assert.rejects(command.action(logger, { options: { chatId: chatId, userName: userPrincipalName, force: true, verbose: true } }), new CommandError(`Member with userName '${userPrincipalName}' could not be found in the chat.`)); }); @@ -174,7 +174,7 @@ describe(commands.CHAT_MEMBER_REMOVE, () => { throw 'Invalid request'; }); - await assert.rejects(command.action(logger, { options: { chatId: chatId, userId: userId, confirm: true, verbose: true } }), + await assert.rejects(command.action(logger, { options: { chatId: chatId, userId: userId, force: true, verbose: true } }), new CommandError(`Member with userId '${userId}' could not be found in the chat.`)); }); diff --git a/src/m365/teams/commands/chat/chat-member-remove.ts b/src/m365/teams/commands/chat/chat-member-remove.ts index a317262e44d..2acea0325e6 100644 --- a/src/m365/teams/commands/chat/chat-member-remove.ts +++ b/src/m365/teams/commands/chat/chat-member-remove.ts @@ -17,7 +17,7 @@ interface Options extends GlobalOptions { id?: string; userId?: string; userName?: string; - confirm?: boolean; + force?: boolean; } class TeamsChatMemberRemoveCommand extends GraphCommand { @@ -44,7 +44,7 @@ class TeamsChatMemberRemoveCommand extends GraphCommand { id: typeof args.options.id !== 'undefined', userId: typeof args.options.userId !== 'undefined', userName: typeof args.options.userName !== 'undefined', - confirm: !!args.options.confirm + force: !!args.options.force }); }); } @@ -64,7 +64,7 @@ class TeamsChatMemberRemoveCommand extends GraphCommand { option: '--userName [userName]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -114,7 +114,7 @@ class TeamsChatMemberRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeUserFromChat(); } else { diff --git a/src/m365/teams/commands/tab/tab-remove.spec.ts b/src/m365/teams/commands/tab/tab-remove.spec.ts index 1f8a47f7cc5..1f255c2af1a 100644 --- a/src/m365/teams/commands/tab/tab-remove.spec.ts +++ b/src/m365/teams/commands/tab/tab-remove.spec.ts @@ -224,7 +224,7 @@ describe(commands.TAB_REMOVE, () => { channelId: '19:f3dcbb1674574677abcae89cb626f1e6@thread.skype', teamId: '00000000-0000-0000-0000-000000000000', id: 'd66b8110-fcad-49e8-8159-0d488ddb7656', - confirm: true + force: true } }); }); @@ -249,7 +249,7 @@ describe(commands.TAB_REMOVE, () => { channelId: '19:f3dcbb1674574677abcae89cb626f1e6@thread.skype', teamId: '00000000-0000-0000-0000-000000000000', tabId: 'd66b8110-fcad-49e8-8159-0d488ddb7656', - confirm: true + force: true } } as any), new CommandError('An error has occurred')); }); diff --git a/src/m365/teams/commands/tab/tab-remove.ts b/src/m365/teams/commands/tab/tab-remove.ts index 4f292cd1e70..047ff07b5a8 100644 --- a/src/m365/teams/commands/tab/tab-remove.ts +++ b/src/m365/teams/commands/tab/tab-remove.ts @@ -15,7 +15,7 @@ interface Options extends GlobalOptions { teamId: string; channelId: string; id: string; - confirm?: boolean; + force?: boolean; } class TeamsTabRemoveCommand extends GraphCommand { @@ -38,7 +38,7 @@ class TeamsTabRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!!args.options.confirm).toString() + force: (!!args.options.force).toString() }); }); } @@ -46,16 +46,16 @@ class TeamsTabRemoveCommand extends GraphCommand { #initOptions(): void { this.options.unshift( { - option: "-t, --teamId " + option: '-t, --teamId ' }, { - option: "-c, --channelId " + option: '-c, --channelId ' }, { - option: "-i, --id " + option: '-i, --id ' }, { - option: "--confirm" + option: '-f, --force' } ); } @@ -97,7 +97,7 @@ class TeamsTabRemoveCommand extends GraphCommand { this.handleRejectedODataJsonPromise(err); } }; - if (args.options.confirm) { + if (args.options.force) { await removeTab(); } else { diff --git a/src/m365/teams/commands/team/team-archive.spec.ts b/src/m365/teams/commands/team/team-archive.spec.ts index 3c4d1621907..d77c52fc779 100644 --- a/src/m365/teams/commands/team/team-archive.spec.ts +++ b/src/m365/teams/commands/team/team-archive.spec.ts @@ -114,7 +114,7 @@ describe(commands.TEAM_ARCHIVE, () => { options: { debug: true, name: 'Finance', - confirm: true + force: true } } as any), new CommandError('The specified team does not exist in the Microsoft Teams')); }); diff --git a/src/m365/teams/commands/team/team-remove.spec.ts b/src/m365/teams/commands/team/team-remove.spec.ts index 62a0aacec7e..4b8296f2fe1 100644 --- a/src/m365/teams/commands/team/team-remove.spec.ts +++ b/src/m365/teams/commands/team/team-remove.spec.ts @@ -108,7 +108,7 @@ describe(commands.TEAM_REMOVE, () => { await assert.rejects(command.action(logger, { options: { name: 'Finance', - confirm: true + force: true } } as any), new CommandError('The specified team does not exist in the Microsoft Teams')); }); @@ -173,7 +173,7 @@ describe(commands.TEAM_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { id: "00000000-0000-0000-0000-000000000000", confirm: true } }); + await command.action(logger, { options: { id: "00000000-0000-0000-0000-000000000000", force: true } }); }); it('removes the specified team by name without prompting when confirmed specified', async () => { @@ -199,7 +199,7 @@ describe(commands.TEAM_REMOVE, () => { throw 'Invalid request'; }); - await command.action(logger, { options: { name: "Finance", confirm: true } }); + await command.action(logger, { options: { name: "Finance", force: true } }); }); it('should handle Microsoft graph error response', async () => { diff --git a/src/m365/teams/commands/team/team-remove.ts b/src/m365/teams/commands/team/team-remove.ts index 0c23449773f..eeb5f8beecf 100644 --- a/src/m365/teams/commands/team/team-remove.ts +++ b/src/m365/teams/commands/team/team-remove.ts @@ -20,7 +20,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id?: string; name?: string; - confirm?: boolean; + force?: boolean; } class TeamsTeamRemoveCommand extends GraphCommand { @@ -44,7 +44,7 @@ class TeamsTeamRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -58,7 +58,7 @@ class TeamsTeamRemoveCommand extends GraphCommand { option: '-n, --name [name]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -111,7 +111,7 @@ class TeamsTeamRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeTeam(); } else { diff --git a/src/m365/teams/commands/team/team-unarchive.spec.ts b/src/m365/teams/commands/team/team-unarchive.spec.ts index b6a7bf65bbd..db34aaaad7a 100644 --- a/src/m365/teams/commands/team/team-unarchive.spec.ts +++ b/src/m365/teams/commands/team/team-unarchive.spec.ts @@ -125,7 +125,7 @@ describe(commands.TEAM_UNARCHIVE, () => { options: { debug: true, name: 'Finance', - confirm: true + force: true } } as any), new CommandError('The specified team does not exist in the Microsoft Teams')); }); diff --git a/src/m365/teams/commands/user/user-app-remove.spec.ts b/src/m365/teams/commands/user/user-app-remove.spec.ts index 34daaa7d6b0..315e5c7ec5e 100644 --- a/src/m365/teams/commands/user/user-app-remove.spec.ts +++ b/src/m365/teams/commands/user/user-app-remove.spec.ts @@ -127,7 +127,7 @@ describe(commands.USER_APP_REMOVE, () => { userId: 'c527a470-a882-481c-981c-ee6efaba85c7', id: 'YzUyN2E0NzAtYTg4Mi00ODFjLTk4MWMtZWU2ZWZhYmE4NWM3IyM0ZDFlYTA0Ny1mMTk2LTQ1MGQtYjJlOS0wZDI4NTViYTA1YTY=', debug: true, - confirm: true + force: true } } as any); }); @@ -176,7 +176,7 @@ describe(commands.USER_APP_REMOVE, () => { options: { userId: 'c527a470-a882-481c-981c-ee6efaba85c7', id: 'YzUyN2E0NzAtYTg4Mi00ODFjLTk4MWMtZWU2ZWZhYmE4NWM3IyM0ZDFlYTA0Ny1mMTk2LTQ1MGQtYjJlOS0wZDI4NTViYTA1YTY=', - confirm: true + force: true } } as any), new CommandError(error.error.message)); }); diff --git a/src/m365/teams/commands/user/user-app-remove.ts b/src/m365/teams/commands/user/user-app-remove.ts index 23f58b11b39..861b224311b 100644 --- a/src/m365/teams/commands/user/user-app-remove.ts +++ b/src/m365/teams/commands/user/user-app-remove.ts @@ -13,7 +13,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: string; userId: string; - confirm?: boolean; + force?: boolean; } class TeamsUserAppRemoveCommand extends GraphCommand { @@ -36,7 +36,7 @@ class TeamsUserAppRemoveCommand extends GraphCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!!args.options.confirm).toString() + force: (!!args.options.force).toString() }); }); } @@ -50,7 +50,7 @@ class TeamsUserAppRemoveCommand extends GraphCommand { option: '--userId ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -87,7 +87,7 @@ class TeamsUserAppRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeApp(); } else { diff --git a/src/m365/todo/commands/list/list-remove.spec.ts b/src/m365/todo/commands/list/list-remove.spec.ts index 4fd41688e8f..a5662bffa1a 100644 --- a/src/m365/todo/commands/list/list-remove.spec.ts +++ b/src/m365/todo/commands/list/list-remove.spec.ts @@ -139,7 +139,7 @@ describe(commands.LIST_REMOVE, () => { await command.action(logger, { options: { name: "FooList", - confirm: true + force: true } } as any); assert.strictEqual(log.length, 0); diff --git a/src/m365/todo/commands/list/list-remove.ts b/src/m365/todo/commands/list/list-remove.ts index 68b8bb2aa2d..1da64d9256a 100644 --- a/src/m365/todo/commands/list/list-remove.ts +++ b/src/m365/todo/commands/list/list-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id?: string; name?: string; - confirm?: boolean; + force?: boolean; } class TodoListRemoveCommand extends GraphCommand { @@ -37,7 +37,7 @@ class TodoListRemoveCommand extends GraphCommand { Object.assign(this.telemetryProperties, { name: typeof args.options.name !== 'undefined', id: typeof args.options.id !== 'undefined', - confirm: typeof args.options.confirm !== 'undefined' + force: typeof args.options.force !== 'undefined' }); }); } @@ -51,7 +51,7 @@ class TodoListRemoveCommand extends GraphCommand { option: '-i, --id [id]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -61,7 +61,7 @@ class TodoListRemoveCommand extends GraphCommand { } public async commandAction(logger: Logger, args: CommandArgs): Promise { - if (args.options.confirm) { + if (args.options.force) { await this.removeList(args); } else { diff --git a/src/m365/todo/commands/task/task-remove.spec.ts b/src/m365/todo/commands/task/task-remove.spec.ts index b1eff43b49b..8f97c7201f3 100644 --- a/src/m365/todo/commands/task/task-remove.spec.ts +++ b/src/m365/todo/commands/task/task-remove.spec.ts @@ -141,7 +141,7 @@ describe(commands.TASK_REMOVE, () => { options: { id: "AAMkAGI3NDhlZmQzLWQxYjAtNGJjNy04NmYwLWQ0M2IzZTNlMDUwNAAuAAAAAACQ1l2jfH6VSZraktP8Z7auAQCbV93BagWITZhL3J6BMqhjAAD9pHIhAAA=", listName: "Tasks", - confirm: true + force: true } }); assert.strictEqual(log.length, 0); diff --git a/src/m365/todo/commands/task/task-remove.ts b/src/m365/todo/commands/task/task-remove.ts index a071765941f..a9fe821dd4b 100644 --- a/src/m365/todo/commands/task/task-remove.ts +++ b/src/m365/todo/commands/task/task-remove.ts @@ -13,7 +13,7 @@ interface Options extends GlobalOptions { id: string; listName?: string; listId?: string; - confirm?: boolean; + force?: boolean; } class TodoTaskRemoveCommand extends GraphCommand { @@ -38,7 +38,7 @@ class TodoTaskRemoveCommand extends GraphCommand { Object.assign(this.telemetryProperties, { listName: typeof args.options.listName !== 'undefined', listId: typeof args.options.listId !== 'undefined', - confirm: typeof args.options.confirm !== 'undefined' + force: typeof args.options.force !== 'undefined' }); }); } @@ -55,7 +55,7 @@ class TodoTaskRemoveCommand extends GraphCommand { option: '--listId [listId]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -106,7 +106,7 @@ class TodoTaskRemoveCommand extends GraphCommand { } }; - if (args.options.confirm) { + if (args.options.force) { await removeToDoTask(); } else { diff --git a/src/m365/yammer/commands/group/group-user-remove.spec.ts b/src/m365/yammer/commands/group/group-user-remove.spec.ts index e85e7ff8c6b..4918f744148 100644 --- a/src/m365/yammer/commands/group/group-user-remove.spec.ts +++ b/src/m365/yammer/commands/group/group-user-remove.spec.ts @@ -120,7 +120,7 @@ describe(commands.GROUP_USER_REMOVE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { debug: true, groupId: 1231231, id: 989998789, confirm: true } }); + await command.action(logger, { options: { debug: true, groupId: 1231231, id: 989998789, force: true } }); assert(requestDeleteStub.called); }); diff --git a/src/m365/yammer/commands/group/group-user-remove.ts b/src/m365/yammer/commands/group/group-user-remove.ts index ac3e4edc113..79613823505 100644 --- a/src/m365/yammer/commands/group/group-user-remove.ts +++ b/src/m365/yammer/commands/group/group-user-remove.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { groupId: number; id?: number; - confirm?: boolean; + force?: boolean; } class YammerGroupUserRemoveCommand extends YammerCommand { @@ -36,7 +36,7 @@ class YammerGroupUserRemoveCommand extends YammerCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { userId: args.options.id !== undefined, - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -50,7 +50,7 @@ class YammerGroupUserRemoveCommand extends YammerCommand { option: '--id [id]' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -90,13 +90,13 @@ class YammerGroupUserRemoveCommand extends YammerCommand { try { await request.delete(requestOptions); - } + } catch (err: any) { this.handleRejectedODataJsonPromise(err); } }; - if (args.options.confirm) { + if (args.options.force) { await executeRemoveAction(); } else { diff --git a/src/m365/yammer/commands/message/message-like-set.spec.ts b/src/m365/yammer/commands/message/message-like-set.spec.ts index 63e4a347613..19c1fd3570a 100644 --- a/src/m365/yammer/commands/message/message-like-set.spec.ts +++ b/src/m365/yammer/commands/message/message-like-set.spec.ts @@ -134,7 +134,7 @@ describe(commands.MESSAGE_LIKE_SET, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { debug: true, messageId: 1231231, confirm: true } }); + await command.action(logger, { options: { debug: true, messageId: 1231231, force: true } }); assert(requestPostedStub.called); }); @@ -158,12 +158,12 @@ describe(commands.MESSAGE_LIKE_SET, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { debug: true, messageId: 1231231, enable: false, confirm: true } }); + await command.action(logger, { options: { debug: true, messageId: 1231231, enable: false, force: true } }); assert(requestPostedStub.called); }); it('prompts when disliking and confirmation parameter is denied', async () => { - await command.action(logger, { options: { messageId: 1231231, enable: false, confirm: false } }); + await command.action(logger, { options: { messageId: 1231231, enable: false, force: false } }); let promptIssued = false; diff --git a/src/m365/yammer/commands/message/message-like-set.ts b/src/m365/yammer/commands/message/message-like-set.ts index 1035c3cd727..148b4834011 100644 --- a/src/m365/yammer/commands/message/message-like-set.ts +++ b/src/m365/yammer/commands/message/message-like-set.ts @@ -12,7 +12,7 @@ interface CommandArgs { interface Options extends GlobalOptions { messageId: number; enable?: boolean; - confirm?: boolean; + force?: boolean; } class YammerMessageLikeSetCommand extends YammerCommand { @@ -37,7 +37,7 @@ class YammerMessageLikeSetCommand extends YammerCommand { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { enable: args.options.enable, - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -52,7 +52,7 @@ class YammerMessageLikeSetCommand extends YammerCommand { autocomplete: ['true', 'false'] }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -102,7 +102,7 @@ class YammerMessageLikeSetCommand extends YammerCommand { }; if (args.options.enable === false) { - if (args.options.confirm) { + if (args.options.force) { await executeLikeAction(); } else { diff --git a/src/m365/yammer/commands/message/message-list.ts b/src/m365/yammer/commands/message/message-list.ts index c50e561b26e..70c379f2c5f 100644 --- a/src/m365/yammer/commands/message/message-list.ts +++ b/src/m365/yammer/commands/message/message-list.ts @@ -61,7 +61,7 @@ class YammerMessageListCommand extends YammerCommand { option: '--olderThanId [olderThanId]' }, { - option: '-f, --feedType [feedType]', + option: '--feedType [feedType]', autocomplete: YammerMessageListCommand.feedTypes }, { @@ -235,7 +235,7 @@ class YammerMessageListCommand extends YammerCommand { }); logger.log(this.items); - } + } catch (err: any) { this.handleRejectedODataJsonPromise(err); } diff --git a/src/m365/yammer/commands/message/message-remove.spec.ts b/src/m365/yammer/commands/message/message-remove.spec.ts index 90a2b95c85f..141a4a6ac33 100644 --- a/src/m365/yammer/commands/message/message-remove.spec.ts +++ b/src/m365/yammer/commands/message/message-remove.spec.ts @@ -85,7 +85,7 @@ describe(commands.MESSAGE_REMOVE, () => { return Promise.reject('Invalid request'); }); - await command.action(logger, { options: { debug: true, id: 10123190123123, confirm: true } }); + await command.action(logger, { options: { debug: true, id: 10123190123123, force: true } }); assert.strictEqual(requestDeleteStub.lastCall.args[0].url, 'https://www.yammer.com/api/v1/messages/10123190123123.json'); }); @@ -100,7 +100,7 @@ describe(commands.MESSAGE_REMOVE, () => { { continue: true } )); - await command.action(logger, { options: { debug: true, id: 10123190123123, confirm: false } }); + await command.action(logger, { options: { debug: true, id: 10123190123123, force: false } }); assert.strictEqual(requestDeleteStub.lastCall.args[0].url, 'https://www.yammer.com/api/v1/messages/10123190123123.json'); }); @@ -116,7 +116,7 @@ describe(commands.MESSAGE_REMOVE, () => { { continue: false } )); - await command.action(logger, { options: { debug: true, id: 10123190123123, confirm: false } }); + await command.action(logger, { options: { debug: true, id: 10123190123123, force: false } }); assert(requestDeleteStub.notCalled); }); @@ -129,7 +129,7 @@ describe(commands.MESSAGE_REMOVE, () => { }); }); - await assert.rejects(command.action(logger, { options: { id: 10123190123123, confirm: true } } as any), new CommandError('An error has occurred.')); + await assert.rejects(command.action(logger, { options: { id: 10123190123123, force: true } } as any), new CommandError('An error has occurred.')); }); it('passes validation with parameters', async () => { diff --git a/src/m365/yammer/commands/message/message-remove.ts b/src/m365/yammer/commands/message/message-remove.ts index 716700fe4c0..cf697277ef9 100644 --- a/src/m365/yammer/commands/message/message-remove.ts +++ b/src/m365/yammer/commands/message/message-remove.ts @@ -11,7 +11,7 @@ interface CommandArgs { interface Options extends GlobalOptions { id: number; - confirm?: boolean; + force?: boolean; } class YammerMessageRemoveCommand extends YammerCommand { @@ -34,7 +34,7 @@ class YammerMessageRemoveCommand extends YammerCommand { #initTelemetry(): void { this.telemetry.push((args: CommandArgs) => { Object.assign(this.telemetryProperties, { - confirm: (!(!args.options.confirm)).toString() + force: (!(!args.options.force)).toString() }); }); } @@ -45,7 +45,7 @@ class YammerMessageRemoveCommand extends YammerCommand { option: '--id ' }, { - option: '--confirm' + option: '-f, --force' } ); } @@ -73,15 +73,15 @@ class YammerMessageRemoveCommand extends YammerCommand { }, responseType: 'json' }; - - await request.delete(requestOptions); - } + + await request.delete(requestOptions); + } catch (err: any) { this.handleRejectedODataJsonPromise(err); } }; - if (args.options.confirm) { + if (args.options.force) { await removeMessage(); } else {