Invoke-PnPSiteTemplate throw error: "Index was outside the bounds of the array" with DefaultColumnValue on Folder in template
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
When provisioning a list whit folder and applying a DefaultColumnValue, in this case on a Choice column the provisioning fails with the error "Index was outside the bounds of the array".
<pnp:DefaultColumnValues>
<pnp:DefaultColumnValue Key="DocumentType" Value="a Contract" />
</pnp:DefaultColumnValues>
<pnp:Properties>
<pnp:Property Key="Title" Value="" />
</pnp:Properties>
</pnp:Folder>```
Invoke-PnpsiteTemplate -Path ./30-lists-Contract-Excluding-Financial-Details.xml
Error: Invoke-PnPSiteTemplate: Index was outside the bounds of the array.
Message : Index was outside the bounds of the array.
Stacktrace : at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in
c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 101
at System.Management.Automation.CommandProcessor.ProcessRecord()
ScriptLineNumber : 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with Invoke-PnPSiteTemplate using 30-lists-Contract-Excluding-Financial-Details.xml and the shown Folder DefaultColumnValue. Start at PnPConnectedCmdlet.cs:101 and trace the provisioning-engine handling of the folder and choice column. Done means the template provisions successfully without the array-bounds error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100