spo term set add
Adds taxonomy term set
Usage
m365 spo term set add [options]
Options
-n, --name <name>
Name of the term set to add.
-u, --webUrl [webUrl]
If specified, allows you to add a term set to the tenant term store as well as the sitecollection specific term store. Defaults to the tenant admin site.
--termGroupId [termGroupId]
ID of the term group in which to create the term set. Specify
termGroupId
ortermGroupName
but not both.--termGroupName [termGroupName]
Name of the term group in which to create the term set. Specify
termGroupId
ortermGroupName
but not both.-i, --id [id]
ID of the term set to add.
-d, --description [description]
Description of the term set to add.
--customProperties [customProperties]
JSON string with key-value pairs representing custom properties to set on the term set.
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options
,examples
,remarks
,response
,full
. Default isoptions
.--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]
Output type.
json
,text
,csv
,md
,none
. Defaultjson
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Remarks
When using the --customProperties
option it's possible to enter a JSON string. In PowerShell 5 to 7.2 specific escaping rules apply due to an issue. Remember that you can also use file tokens instead.
To use this command without the --webUrl
option you have to have permissions to access the tenant admin site.
When using the --webUrl
option you can connect to the term store with limited permissions, and do not need the SharePoint Administrator role. You need to be a site visitor or more. It allows you to add a term set to a term group in the tenant term store if you are listed as a term store administrator. It allows you to add a term set to a term group in the sitecollection term store if you are a site owner.
Examples
Add taxonomy term set to the term group specified by ID.
m365 spo term set add --name PnP-Organizations --termGroupId 0e8f395e-ff58-4d45-9ff7-e331ab728beb
Add taxonomy term set to the specified sitecollection's term group specified by ID.
m365 spo term set add --name PnP-Organizations --termGroupId 0e8f395e-ff58-4d45-9ff7-e331ab728beb --webUrl https://contoso.sharepoint.com/sites/project-x
Add taxonomy term set to the term group specified by name. Create the term set with the specified ID.
m365 spo term set add --name PnP-Organizations --termGroupName PnPTermSets --id aa70ede6-83d1-466d-8d95-30d29e9bbd7c
Add taxonomy term set and set its description.
m365 spo term set add --name PnP-Organizations --termGroupId 0e8f395e-ff58-4d45-9ff7-e331ab728beb --description 'Contains a list of organizations'
Add taxonomy term set and set its custom properties.
m365 spo term set add --name PnP-Organizations --termGroupId 0e8f395e-ff58-4d45-9ff7-e331ab728beb --customProperties '{"Property":"Value"}'
Response
Standard response
- JSON
- Text
- CSV
- Markdown
{
"CreatedDate": "2023-05-14T10:28:31.041Z",
"Id": "c28cfcd2-0705-4b7b-b8e6-ba2fb107e5ec",
"LastModifiedDate": "2023-05-14T10:28:31.041Z",
"Name": "PnP-Organizations",
"CustomProperties": {},
"CustomSortOrder": null,
"IsAvailableForTagging": true,
"Owner": "i:0#.f|membership|john.doe@contoso.com",
"Contact": "",
"Description": "",
"IsOpenForTermCreation": false,
"Names": {
"1033": "PnP-Organizations"
},
"Stakeholders": []
}
Contact :
CreatedDate : 2023-05-14T10:30:41.018Z
CustomProperties : {}
CustomSortOrder : null
Description :
Id : 41102744-9f7b-448b-a265-3bbe3db5c064
IsAvailableForTagging: true
IsOpenForTermCreation: false
LastModifiedDate : 2023-05-14T10:30:41.018Z
Name : PnP-Organizations
Names : {"1033":"PnP-Organizations"}
Owner : i:0#.f|membership|john.doe@contoso.com
Stakeholders : []
CreatedDate,Id,LastModifiedDate,Name,IsAvailableForTagging,Owner,Contact,Description,IsOpenForTermCreation
2023-05-14T10:31:11.299Z,8f212d7d-eeb3-454b-811a-01b38fea56e1,2023-05-14T10:31:11.299Z,PnP-Organizations,1,i:0#.f|membership|john.doe@contoso.com,,,
# spo term set add --name "PnP-Organizations" --termGroupId "0e8f395e-ff58-4d45-9ff7-e331ab728beb"
Date: 5/14/2023
## PnP-Organizations (73824553-d254-44ef-ac0f-61926b65e925)
Property | Value
---------|-------
CreatedDate | 2023-05-14T10:31:42.422Z
Id | 73824553-d254-44ef-ac0f-61926b65e925
LastModifiedDate | 2023-05-14T10:31:42.422Z
Name | PnP-Organizations
IsAvailableForTagging | true
Owner | i:0#.f\|membership\|john.doe@contoso.com
Contact |
Description |
IsOpenForTermCreation | false