Skip to content

Commit a2f266b

Browse files
committed
Rename Apply-PnPTenantTemplate to Set-PnPTenantTemplate
1 parent 9432f6e commit a2f266b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Commands/Provisioning/Tenant/ApplyTenantTemplate.cs renamed to Commands/Provisioning/Tenant/SetTenantTemplate.cs

+11-7
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@
1717

1818
namespace SharePointPnP.PowerShell.Commands.Provisioning.Tenant
1919
{
20-
[Cmdlet("Apply", "PnPTenantTemplate", SupportsShouldProcess = true)]
21-
[Alias("Apply-PnPProvisioningHierarchy")]
20+
[Cmdlet(VerbsCommon.Set, "PnPTenantTemplate", SupportsShouldProcess = true)]
21+
[Alias("Apply-PnPTenantTemplate", "Apply-PnPProvisioningHierarchy")]
2222
[CmdletHelp("Applies a tenant template to the current tenant. You must be a SharePoint Online global administrator to run the cmdlet.",
2323
Category = CmdletHelpCategory.Provisioning, SupportedPlatform = CmdletSupportedPlatform.Online)]
2424
[CmdletExample(
25-
Code = @"PS:> Apply-PnPTenantTemplate -Path myfile.pnp",
25+
Code = @"PS:> Set-PnPTenantTemplate -Path myfile.pnp",
2626
Remarks = "Will read the tenant template from the filesystem and will apply the sequences in the template",
2727
SortOrder = 1)]
2828
[CmdletExample(
29-
Code = @"PS:> Apply-PnPTenantTemplate -Path myfile.pnp -SequenceId ""mysequence""",
29+
Code = @"PS:> Set-PnPTenantTemplate -Path myfile.pnp -SequenceId ""mysequence""",
3030
Remarks = "Will read the tenant template from the filesystem and will apply the specified sequence in the template",
3131
SortOrder = 1)]
3232
[CmdletExample(
33-
Code = @"PS:> Apply-PnPTenantTemplate -Path myfile.pnp -Parameters @{""ListTitle""=""Projects"";""parameter2""=""a second value""}",
33+
Code = @"PS:> Set-PnPTenantTemplate -Path myfile.pnp -Parameters @{""ListTitle""=""Projects"";""parameter2""=""a second value""}",
3434
Remarks = @"Applies a tenant template to the current tenant. It will populate the parameter in the template the values as specified and in the template you can refer to those values with the {parameter:<key>} token.
3535
3636
For instance with the example above, specifying {parameter:ListTitle} in your template will translate to 'Projects' when applying the template. These tokens can be used in most string values in a template.",
3737
SortOrder = 3)]
38-
public class ApplyTenantTemplate : PnPAdminCmdlet
38+
public class SetTenantTemplate : PnPAdminCmdlet
3939
{
4040
private const string ParameterSet_PATH = "By Path";
4141
private const string ParameterSet_OBJECT = "By Object";
@@ -90,7 +90,11 @@ protected override void ExecuteCmdlet()
9090
{
9191
if (MyInvocation.InvocationName.ToLower() == "apply-pnpprovisioninghierarchy")
9292
{
93-
WriteWarning("Apply-PnPProvisioningHierarchy has been deprecated. Use Apply-PnPTenantTemplate instead.");
93+
WriteWarning("Apply-PnPProvisioningHierarchy has been deprecated. Use Set-PnPTenantTemplate instead.");
94+
}
95+
if (MyInvocation.InvocationName.ToLower() == "apply-pnptenanttemplate")
96+
{
97+
WriteWarning("Apply-PnPTenantTemplate has been deprecated. Use Set-PnPTenantTemplate instead.");
9498
}
9599

96100
var sitesProvisioned = new List<ProvisionedSite>();

Commands/SharePointPnP.PowerShell.Commands.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@
641641
<Compile Include="Principals\GetAlert.cs" />
642642
<Compile Include="Principals\AddAlert.cs" />
643643
<Compile Include="Provisioning\Site\ExportListToProvisioningTemplate.cs" />
644-
<Compile Include="Provisioning\Tenant\ApplyTenantTemplate.cs" />
644+
<Compile Include="Provisioning\Tenant\SetTenantTemplate.cs" />
645645
<Compile Include="Provisioning\Tenant\ReadTenantTemplate.cs" />
646646
<Compile Include="Provisioning\Tenant\SaveTenantTemplate.cs" />
647647
<Compile Include="Provisioning\Tenant\TestTenantTemplate.cs" />

0 commit comments

Comments
 (0)