-
Notifications
You must be signed in to change notification settings - Fork 399
Description
Notice
Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:
- Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
Reporting an Issue or Missing Feature
New-PnPSite gives the error : New-PnPSite: Object reference not set to an instance of an object.
Expected behavior
Expected behavior is to create a new TeamSite
Actual behavior
Error from PS:

Error from Azure function:
Exception :
Type : System.NullReferenceException
TargetSite :
Name : ExecuteCmdlet
DeclaringType : PnP.PowerShell.Commands.NewSite
MemberType : Method
Module : PnP.PowerShell.dll
Message : Object reference not set to an instance of an object.
Data : System.Collections.ListDictionaryInternal
Source : PnP.PowerShell
HResult : -2147467261
StackTrace :
at PnP.PowerShell.Commands.NewSite.ExecuteCmdlet() in c:\build\src\Commands\Admin\NewSite.cs:line 133
at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 53
CategoryInfo : WriteError: (:) [New-PnPSite], NullReferenceException
Steps to reproduce behavior
$Connection = Connect-PnPOnline -Url $Url -ClientId $app.ClientId -Thumbprint $app.Thumbprint -Tenant $app.Tenant -ReturnConnection -ErrorAction Stop;
New-PnPSite -Type TeamSite -Title "PNP2.2" -Alias "Bla bla bla" -Connection $Connection -Wait -ErrorAction Stop;
What is the version of the Cmdlet module you are running?
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify
