SOLVED

Invoke-PnPSiteTemplate : Error applying default column values

Copper Contributor

Hello All,

 

Few weeks back my PS script was working fine but client told to change few list columns. 

My script is not working after that and showing the below error.

 

RamBhajan_0-1689776887863.png

I have checked list columns but I did not see anything wrong. Could you please guide me how to rectify this issue.

 

Thank you.

Ram

9 Replies
How has it gone ? What kind of field is it ?

Hi @RamBhajan 

I would enable the PnP trace first

Set-PnPTraceLog -On -Level Debug

And then run your command again.
This will tell you in detail what exactly the "Invoke-PnPSiteTemplate" command does.
You should either get an additional error message or the at least the problematic field (That is the last field the command wanted to update in the trace)

Then we can have a deeper look at why this is happening.

Best Regards,
Sven

@SvenSieverding 

 

Thank you for your message.

 

Let me tell you what I am trying to do.

 

I have one SP online template site which is containing nearly 15 lists and libraries along with master data. I am creating xml file template based on the template site and applying to a different site using PnP PowerShell.


I am doing the same using the below command.

 

Set-PnPTraceLog -On -LogFile $FilePath -Level Debug

 

But it is not showing any similar error in the error log file which I can see in the console.

@NicolasKheirallah

Thank you for your message.


I have one template site which is containing nearly 15 lists and libraries along with data. I am creating xml file template based on this template site and applying to a different site using PnP PowerShell.

So no idea which field type it is throwing error for.
@ibmuser I am not sure how your reply can assist my issue. It would be great if you can elaborate.

Thank you!
best response confirmed by RamBhajan (Copper Contributor)
Solution
Reduce the XML and try each list for it's own see which ones is giving you an issues. Basicly method of exclution
@NicolasKheirallah - I am doing the same. I will update once I get something. Thank you.
Hi RamBhajan,

Please check the PnP PowerShell version and if its latest then try the same without set default value.
By this you can find the problem and get this fixed.
@NicolasKheirallah I have done the same but I am surprised it did not show any error now. As of now the script is working as expected.
Thank you!
1 best response

Accepted Solutions
best response confirmed by RamBhajan (Copper Contributor)
Solution
Reduce the XML and try each list for it's own see which ones is giving you an issues. Basicly method of exclution

View solution in original post