Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Missing parameters on #831

Closed
khha opened this issue Oct 28, 2016 · 2 comments
Closed

Missing parameters on #831

khha opened this issue Oct 28, 2016 · 2 comments

Comments

@khha
Copy link

khha commented Oct 28, 2016

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. If you have a actual question, we would ask you to use PnP Yammer group at http://aka.ms/OfficeDevPnPYammer. Thanks!

Which PnP repository to report the issue?

You can delete this section after you have confirmed target repository for your submission.

Category

[ ] Bug
[ ] Enhancement

Environment

[ ] Office 365 / SharePoint Online
[ ] SharePoint 2016
[V ] SharePoint 2013

In pnp-PowerShell it is possible to add parameters to the function ApplyProvisioningTemplate. Is this also possible with pnp core csom?

Here is an example of the pnp-Powershell function:

Apply-SPOProvisioningTemplate -Path "Template.xml" -Parameters @{"SiteOwnerMail"="someone@example.com"}

Here is an example of my pnp core csom:

XMLTemplateProvider provider = new XMLFileSystemTemplateProvider(String.Format(@"{0}\Templates\", AppDomain.CurrentDomain.BaseDirectory), "");

            if (provider != null)
            {
                var template = provider.GetTemplate("PeriodeTemplate.xml");

                if (template != null)
                {
                    newWeb.ApplyProvisioningTemplate(template);

                    return true;
                }
            }
@erwinvanhunen
Copy link
Member

erwinvanhunen commented Nov 3, 2016

Yes, that's very possible:

var template = provider.GetTemplate("PeriodeTemplate.xml");
template.Parameters.Add("SiteOwnerEmail","someone@example.com");

notice that the template, when retrieved through a provider is not XML anymore but a rich object with all the collections like parameters, listinstances, sitefields etc. there.

@khha
Copy link
Author

khha commented Nov 7, 2016

Thanks it works!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants