Usage
spo site ensure [options]
Description
Ensures that the particular site collection exists and updates its properties if necessary. The command is a combination of spo site get, spo site add and spo site set.
Options
| Option |
Description |
--help |
output usage information |
-u, --url <url> |
URL of the site collection to work with |
--type [type] |
Type of site. Allowed values TeamSite,CommunicationSite, default TeamSite |
-a, --alias [alias] |
Site alias, used in the URL and in the team site group e-mail (applies only to team sites) |
-t, --title [title] |
Site title |
-d, --description [description] |
Site description |
-c, --classification [classification] |
Site classification |
-l, --lcid [lcid] |
Site language in the LCID format, eg. 1033 for en-US |
--isPublic |
Determines if the associated group is public or not (applies only to team sites) |
--shareByEmailEnabled [shareByEmailEnabled] |
Set to true to allow to share files with guests (applies only to communication sites) |
--siteDesign [siteDesign] |
Type of communication site to create. Allowed values Topic,Showcase,Blank, default Topic. When creating a communication site, specify either siteDesign or siteDesignId (applies only to communication sites) |
--siteDesignId [siteDesignId] |
Id of the custom site design to use to create the site. When creating a communication site, specify either siteDesign or siteDesignId (applies only to communication sites) |
--owners [owners] |
Comma-separated list of users to set as site owners (applies only to team sites) |
--classification [classification] |
The classification for the site collection |
--disableFlows [disableFlows] |
Set to true to disable using Microsoft Flow in this site collection |
--query [query] |
JMESPath query string. See http://jmespath.org/ for more information and examples |
-o, --output [output] |
Output type. json,text. Default text |
--pretty |
Prettifies json output |
--verbose |
Runs command with verbose logging |
--debug |
Runs command with debug logging |
Additional Information
If you specify the type option and the template of the existing site doesn't match it, the command will return an error. If you don't specify type and the site already exists, the command will not validate the type. If you don't specify type and no site exists at the specified URL, the command will create a team site (default value).
If you set the type option to TeamSite or don't specify it, you must specify the alias option which is required to create a team site if it doesn't exist.
If you specify the lcid option and the language of the existing site doesn't match it, the command will return an error.
If the specified site already exists, options alias, siteDesign and siteDesignId are ignored because they're used only for site creation.
@garrytrinder @VelinGeorgiev looking forward to your feedback on the spec
Usage
spo site ensure [options]Description
Ensures that the particular site collection exists and updates its properties if necessary. The command is a combination of
spo site get,spo site addandspo site set.Options
--help-u, --url <url>--type [type]TeamSite,CommunicationSite, defaultTeamSite-a, --alias [alias]-t, --title [title]-d, --description [description]-c, --classification [classification]-l, --lcid [lcid]--isPublic--shareByEmailEnabled [shareByEmailEnabled]trueto allow to share files with guests (applies only to communication sites)--siteDesign [siteDesign]Topic,Showcase,Blank, defaultTopic. When creating a communication site, specify eithersiteDesignorsiteDesignId(applies only to communication sites)--siteDesignId [siteDesignId]siteDesignorsiteDesignId(applies only to communication sites)--owners [owners]--classification [classification]--disableFlows [disableFlows]trueto disable using Microsoft Flow in this site collection--query [query]-o, --output [output]json,text. Defaulttext--prettyjsonoutput--verbose--debugAdditional Information
If you specify the
typeoption and the template of the existing site doesn't match it, the command will return an error. If you don't specifytypeand the site already exists, the command will not validate the type. If you don't specifytypeand no site exists at the specified URL, the command will create a team site (default value).If you set the
typeoption toTeamSiteor don't specify it, you must specify thealiasoption which is required to create a team site if it doesn't exist.If you specify the
lcidoption and the language of the existing site doesn't match it, the command will return an error.If the specified site already exists, options
alias,siteDesignandsiteDesignIdare ignored because they're used only for site creation.@garrytrinder @VelinGeorgiev looking forward to your feedback on the spec