Forum Discussion

Dean_Gross's avatar
Dean_Gross
Silver Contributor
Oct 20, 2017
Solved

Creating modern site with PnP powershell

I'm getting the following error with the latest PnP Online module. Does this work for anyone?

 

New-PnPSite -Type TeamSite -Title Portfolio -Alias pc
New-PnPSite : Object reference not set to an instance of an object.
At line:1 char:1
+ New-PnPSite -Type TeamSite -Title Portfolio -Alias pc
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [New-PnPSite], NullReferenceException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.NewSite

 

Erwin van Hunen

  • I initially was thinking it was due to the way you login, as we fixed an issue with using the -WebLogin parameters. But indeed, in your case it is the mailnickname that is causing the issue, it is not related to your login. Indeed, the Alias parameter value cannot contain a space. 

     

    I'll add a check in the backend code for that.

Resources