Replies: 1 comment 1 reply
-
This repo covers PnP.PowerShell, not the legacy repos (that is deprecated). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am working on a provisioning script for SharePoint 2016 on-prem (using latest version of SharePointPnPPowerShell2016). So far everything is working as expected but I am encountering a couple issues with Add-PnPDataRowsToProvisioningTemplate ...
===================================================================================
First, I am using Get-PnPProvisioningTemplate cmdlet to generate a set of template files from my source/template site. Once I have these component template files, I use Apply-PnPProvisioningTemplate to apply all of these template files against my target site to properly provision and configure it. All of this works pretty well so far except for a couple of issues I am trying to fix.
First, using the below I generate a template file for my lists that I want from the template site:
$handlers = "Lists"
Get-PnPProvisioningTemplate -Out ($workingFolder + "Template-4-SPLIST.xml") -Handlers $handlers -IncludeHiddenLists
This generates the Template-4-SPLIST.xml as expected. I then use this cmdlet to add list items from a couple of lists into my template:
Add-PnPDataRowsToProvisioningTemplate -Path ($workingFolder + "Template-4-SPLIST.xml") -List "Promoted Links".
For the Promoted Links (std SP list) list this works fine and when I check the XML file, I do see a pnp:DataRow element get added for this list and it is correct. However, when I run this template against my target site, the Promoted Links list gets added, but the data row is not added ... Is there some trick to getting list items specified via the DataRow element added to the list in the target site?
===================================================================================
Second, I also have a Site Contacts list (again the std SP list) and I want to also include it (and one entry in this list) to be added to the target site, but when I run the same cmdlet as above
Add-PnPDataRowsToProvisioningTemplate -Path ($workingFolder + "Template-4-SPLIST.xml") -List "Site Contacts"
I get this error:
Add-PnPDataRowsToProvisioningTemplate : The property or field 'Id' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly
requested.
At line:1 char:1
===================================================================================
Any thoughts or ideas appreciated.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions