Invoke-PnPSiteTemplate causes an object reference not set to an instance of an object error at Line 1 Character 1
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
If I try - Invoke-PnPSiteTemplate -Path C:\template.pnp -Parameters @{'CompanyName' = $companyName; 'Year' = $year; 'Month' = $month } as per the New PowerApps Communications Template - https://learn.microsoft.com/en-us/power-platform/guidance/adoption/wiki-community I get an error 👎 Invoke-PnPSiteTemplate : Object reference not set to an instance of an object.
At line:1 char:5
-
Invoke-PnPSiteTemplate -Path C:\template.pnp -Parameters @{'Compa ... -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : WriteError: (:) [Invoke-PnPSiteTemplate], NullReferenceException
- FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Provisioning.Site.InvokeSiteTemplate
If I just type PS C:> Invoke-PnPSiteTemplate
Invoke-PnPSiteTemplate : Object reference not set to an instance of an object.
At line:1 char:1
- Invoke-PnPSiteTemplate
-
+ CategoryInfo : WriteError: (:) [Invoke-PnPSiteTemplate], NullReferenceException + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Provisioning.Site.InvokeSiteTemplate
So this looks like an issue with Invoke-PnPSiteTemplate.
Anybody any ideas why ? Have I missed something ?
Should PnP.Framework be here somewhere ? I cannot seem to install it.
Thanks
Nigel
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
Start by reproducing the failure with the shown Invoke-PnPSiteTemplate command, both with and without -Path and -Parameters, and review the linked New PowerApps Communications Template guidance. Trace the Invoke-PnPSiteTemplate entry point to identify why it raises NullReferenceException; done means the cause and required invocation or configuration are established and covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100