Forum Discussion

RamBhajan's avatar
RamBhajan
Copper Contributor
Jul 19, 2023
Solved

Invoke-PnPSiteTemplate : Error applying default column values

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.

 

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

  • Reduce the XML and try each list for it's own see which ones is giving you an issues. Basicly method of exclution
  • Vivek Jagga's avatar
    Vivek Jagga
    Copper Contributor
    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.
  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    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

    • RamBhajan's avatar
      RamBhajan
      Copper Contributor

      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.

    • RamBhajan's avatar
      RamBhajan
      Copper Contributor
      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.
      • Reduce the XML and try each list for it's own see which ones is giving you an issues. Basicly method of exclution

Resources