pnp / pnpframework

PnP Framework is a .NET library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions
https://pnp.github.io/pnpframework/
MIT License
205 stars 143 forks source link

Get-PnPSiteTemplate -Out lists.xml -Handlers Lists - Exception: Object reference not set to an instance of an object. #992

Open RickardLoefberg opened 6 months ago

RickardLoefberg commented 6 months ago

Getting "Object reference not set to an instance of an object" when trying to generate the template. It fails on the same list every time I run the command.

PS C:\Users\xxxxx> Connect-PnPOnline https://xxxx.sharepoint.com/sites/xxxxx/yyyyy-Interactive
PS C:\Users\xxxxx> Get-PnPSiteTemplate -Out lists.xml -Handlers Lists -Force
Get-PnPSiteTemplate: Object reference not set to an instance of an object.
PS C:\Users\xxxxx> Get-PnPException

Message          : Object reference not set to an instance of an object.
Stacktrace       :    at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in
                   c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 101
                      at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord() in
                   c:\build\src\Commands\Base\PnPSharePointCmdlet.cs:line 131
                      at System.Management.Automation.CommandProcessor.ProcessRecord()
ScriptLineNumber : 1

Running PnP.PowerShell version 2.4.0. User is site collection administrator