Skip to content

Commit 24900d3

Browse files
ktskumarMathijsVerbeeck
authored andcommitted
Renames command 'spo site list' to 'spo tenant site list'. Closes #6143
1 parent 303b62c commit 24900d3

File tree

11 files changed

+58
-23
lines changed

11 files changed

+58
-23
lines changed

docs/docs/about/release-notes.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3848,7 +3848,7 @@ sidebar_position: 3
38483848
- added information about the current user to status commands [#202](https://github.com/pnp/cli-microsoft365/issues/202)
38493849
- fixed issue with completing input that doesn't match commands [#222](https://github.com/pnp/cli-microsoft365/issues/222)
38503850
- fixed issue with escaping numeric input [#226](https://github.com/pnp/cli-microsoft365/issues/226)
3851-
- changed the [entra oauth2grant list](../cmd/entra/oauth2grant/oauth2grant-list.mdx), [spo app list](../cmd/spo/app/app-list.mdx), [spo customaction list](../cmd/spo/customaction/customaction-list.mdx), [spo site list](../cmd/spo/site/site-list.mdx) commands to list all properties for output type JSON [#232](https://github.com/pnp/cli-microsoft365/issues/232), [#233](https://github.com/pnp/cli-microsoft365/issues/233), [#234](https://github.com/pnp/cli-microsoft365/issues/234), [#235](https://github.com/pnp/cli-microsoft365/issues/235)
3851+
- changed the [entra oauth2grant list](../cmd/entra/oauth2grant/oauth2grant-list.mdx), [spo app list](../cmd/spo/app/app-list.mdx), [spo customaction list](../cmd/spo/customaction/customaction-list.mdx), [spo site list](../cmd/spo/tenant/tenant-site-list.mdx) commands to list all properties for output type JSON [#232](https://github.com/pnp/cli-microsoft365/issues/232), [#233](https://github.com/pnp/cli-microsoft365/issues/233), [#234](https://github.com/pnp/cli-microsoft365/issues/234), [#235](https://github.com/pnp/cli-microsoft365/issues/235)
38523852
- fixed issue with generating clink completion file [#252](https://github.com/pnp/cli-microsoft365/issues/252)
38533853
- added [user guide](../user-guide/installing-cli.mdx) [#236](https://github.com/pnp/cli-microsoft365/issues/236), [#237](https://github.com/pnp/cli-microsoft365/issues/237), [#238](https://github.com/pnp/cli-microsoft365/issues/238), [#239](https://github.com/pnp/cli-microsoft365/issues/239)
38543854

@@ -3864,7 +3864,7 @@ sidebar_position: 3
38643864

38653865
- [spo customaction list](../cmd/spo/customaction/customaction-list.mdx) - lists user custom actions for site or site collection [#19](https://github.com/pnp/cli-microsoft365/issues/19)
38663866
- [spo site get](../cmd/spo/site/site-get.mdx) - gets information about the specific site collection [#114](https://github.com/pnp/cli-microsoft365/issues/114)
3867-
- [spo site list](../cmd/spo/site/site-list.mdx) - lists modern sites of the given type [#115](https://github.com/pnp/cli-microsoft365/issues/115)
3867+
- [spo site list](../cmd/spo/tenant/tenant-site-list.mdx) - lists modern sites of the given type [#115](https://github.com/pnp/cli-microsoft365/issues/115)
38683868
- [spo site add](../cmd/spo/site/site-add.mdx) - creates new modern site [#116](https://github.com/pnp/cli-microsoft365/issues/116)
38693869
- [spo app remove](../cmd/spo/app/app-remove.mdx) - removes the specified app from the tenant app catalog [#9](https://github.com/pnp/cli-microsoft365/issues/9)
38703870
- [spo site appcatalog add](../cmd/spo/site/site-appcatalog-add.mdx) - creates a site collection app catalog in the specified site [#63](https://github.com/pnp/cli-microsoft365/issues/63)

docs/docs/cmd/spo/site/site-list.mdx renamed to docs/docs/cmd/spo/tenant/tenant-site-list.mdx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ import Global from '/docs/cmd/_global.mdx';
22
import Tabs from '@theme/Tabs';
33
import TabItem from '@theme/TabItem';
44

5-
# spo site list
5+
# spo tenant site list
66

77
Lists modern sites of the given type
88

99
## Usage
1010

1111
```sh
12-
m365 spo site list [options]
12+
m365 spo tenant site list [options]
13+
```
14+
15+
## Alias
16+
17+
```sh
18+
m365 spo site list
1319
```
1420

1521
## Options
@@ -49,31 +55,31 @@ To use this command you have to have permissions to access the tenant admin site
4955
List all sites in the currently connected tenant
5056

5157
```sh
52-
m365 spo site list
58+
m365 spo tenant site list
5359
```
5460

5561
List all group connected team sites in the currently connected tenant
5662

5763
```sh
58-
m365 spo site list --type TeamSite
64+
m365 spo tenant site list --type TeamSite
5965
```
6066

6167
List all communication sites in the currently connected tenant
6268

6369
```sh
64-
m365 spo site list --type CommunicationSite
70+
m365 spo tenant site list --type CommunicationSite
6571
```
6672

6773
List all group connected team sites that contain _project_ in the URL
6874

6975
```sh
70-
m365 spo site list --type TeamSite --filter "Url -like 'project'"
76+
m365 spo tenant site list --type TeamSite --filter "Url -like 'project'"
7177
```
7278

7379
List all sites in the currently connected tenant including OneDrive sites
7480

7581
```sh
76-
m365 spo site list --includeOneDriveSites
82+
m365 spo tenant site list --includeOneDriveSites
7783
```
7884

7985
## Response

docs/docs/v6-upgrade-guidance.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In CLI for Microsoft 365 we had several commands that were originally targeted a
99
Command | Merged with
1010
--|--
1111
`spo site classic add` | [spo site add](./cmd/spo/site/site-add.mdx)
12-
`spo site classic list` | [spo site list](./cmd/spo/site/site-list.mdx)
12+
`spo site classic list` | [spo site list](./cmd/spo/tenant/tenant-site-list.mdx)
1313
`spo site classic set` | [spo site set](./cmd/spo/site/site-set.mdx)
1414

1515
To fix a resulting issue with the `spo site list` command, the default value of the `type` option of that command has been removed.

docs/docs/v7-upgrade-guidance.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Update your scripts to use the new options. Verify that your scripts work as int
128128

129129
### Removed `deleted` flag from `spo site list` command
130130

131-
In the previous versions of CLI for Microsoft 365, you could get deleted sites from your SharePoint tenant using the command [spo site list](./cmd/spo/site/site-list.mdx) by providing the flag `--deleted`. In the latest release, we have removed this option from the command. To get all deleted sites in your tenant, you can now use the command [spo tenant recyclebinitem list](./cmd/spo/tenant/tenant-recyclebinitem-list.mdx).
131+
In the previous versions of CLI for Microsoft 365, you could get deleted sites from your SharePoint tenant using the command [spo site list](./cmd/spo/tenant/tenant-site-list.mdx) by providing the flag `--deleted`. In the latest release, we have removed this option from the command. To get all deleted sites in your tenant, you can now use the command [spo tenant recyclebinitem list](./cmd/spo/tenant/tenant-recyclebinitem-list.mdx).
132132

133133
#### What action do I need to take?
134134

docs/src/config/sidebars.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3400,7 +3400,7 @@ const sidebars: SidebarsConfig = {
34003400
{
34013401
type: 'doc',
34023402
label: 'site list',
3403-
id: 'cmd/spo/site/site-list'
3403+
id: 'cmd/spo/tenant/tenant-site-list'
34043404
},
34053405
{
34063406
type: 'doc',
@@ -3748,6 +3748,11 @@ const sidebars: SidebarsConfig = {
37483748
label: 'tenant site archive',
37493749
id: 'cmd/spo/tenant/tenant-site-archive'
37503750
},
3751+
{
3752+
type: 'doc',
3753+
label: 'tenant site list',
3754+
id: 'cmd/spo/tenant/tenant-site-list'
3755+
},
37513756
{
37523757
type: 'doc',
37533758
label: 'tenant site rename',

src/index.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ describe('Lazy loading commands', () => {
8383
'search externalconnection remove',
8484
'search externalconnection schema add',
8585
'spo folder rename',
86+
'spo site list',
8687
'spo page template remove',
8788
'spo sp grant add',
8889
'spo sp grant list',

src/m365/spo/commands.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,9 @@ export default {
323323
TENANT_SETTINGS_LIST: `${prefix} tenant settings list`,
324324
TENANT_SETTINGS_SET: `${prefix} tenant settings set`,
325325
TENANT_SITE_ARCHIVE: `${prefix} tenant site archive`,
326-
TENANT_SITE_MEMBERSHIP_LIST: `${prefix} tenant site membership list`,
326+
TENANT_SITE_LIST: `${prefix} tenant site list`,
327327
TENANT_SITE_RENAME: `${prefix} tenant site rename`,
328+
TENANT_SITE_MEMBERSHIP_LIST: `${prefix} tenant site membership list`,
328329
TENANT_SITE_UNARCHIVE: `${prefix} tenant site unarchive`,
329330
TERM_ADD: `${prefix} term add`,
330331
TERM_GET: `${prefix} term get`,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { TenantSiteProperties } from './TenantSiteProperties.js';
2+
3+
export interface SPOTenantSitePropertiesEnumerable {
4+
_Child_Items_: TenantSiteProperties[];
5+
NextStartIndex: number;
6+
NextStartIndexFromSharePoint: string;
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export interface TenantSiteProperties {
2+
Status: string;
3+
Title: string;
4+
Url: string;
5+
SiteId?: string;
6+
}

src/m365/spo/commands/site/site-list.spec.ts renamed to src/m365/spo/commands/tenant/tenant-site-list.spec.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import { session } from '../../../../utils/session.js';
1313
import { sinonUtil } from '../../../../utils/sinonUtil.js';
1414
import { spo } from '../../../../utils/spo.js';
1515
import commands from '../../commands.js';
16-
import command from './site-list.js';
16+
import command from './tenant-site-list.js';
1717

18-
describe(commands.SITE_LIST, () => {
18+
describe(commands.TENANT_SITE_LIST, () => {
1919
let log: string[];
2020
let logger: Logger;
2121
let loggerLogSpy: sinon.SinonSpy;
@@ -61,7 +61,7 @@ describe(commands.SITE_LIST, () => {
6161
});
6262

6363
it('has correct name', () => {
64-
assert.strictEqual(command.name, commands.SITE_LIST);
64+
assert.strictEqual(command.name, commands.TENANT_SITE_LIST);
6565
});
6666

6767
it('has a description', () => {
@@ -599,4 +599,9 @@ describe(commands.SITE_LIST, () => {
599599

600600
await assert.rejects(command.action(logger, { options: { debug: true, filter: "Url like 'ctest'" } } as any), new CommandError('An error has occurred'));
601601
});
602+
603+
it('defines alias', () => {
604+
const alias = command.alias();
605+
assert.notStrictEqual(typeof alias, 'undefined');
606+
});
602607
});

0 commit comments

Comments
 (0)