pnp / pnp/powershell

[BUG] The SiteAlias parameter is not taken into account by New-PnPSite cmdlet

Open
#4,275 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
904
Forks
407
Avg merge
9h 16m
Merged PRs (30d)
10

Description

Reporting an Issue or Missing Feature

The SiteAlias parameter has no effect when running New-PnPSite.

Expected behavior

According to Example 10 in the documentation of this cmdlet:
This will create a new Modern Team Site collection with the title 'Team Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso-site' or 'https://tenant.sharepoint.com/teams/contoso-site' based on the managed path configuration in the SharePoint Online Admin portal. The underlying M365 Group will have 'contoso' as the alias.

Actual behavior

I have run the exact same command as in this example:
New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -SiteAlias contoso-site

I could see the output "https://tenant.sharepoint.com/sites/contoso", and corresponding site has been created but with contoso instead of contoso-site.

Steps to reproduce behavior
$rootConnection = Connect-PnPOnline -Url $url -ClientId $clientId -Thumbprint $tumbprint -Tenant $tenant -ReturnConnection -ErrorAction SilentlyContinue
New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -SiteAlias contoso-site -Connection $rootConnection -ErrorAction Stop
What is the version of the Cmdlet module you are running?

As the script is running in PS 5:
Import-Module PnP.PowerShell -RequiredVersion 1.12.0 -DisableNameChecking:$true -ErrorAction Stop

Which operating system/environment are you running PnP PowerShell on?
  • [X ] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the New-PnPSite cmdlet implementation and compare its handling of -Alias and -SiteAlias with the documented Example 10. Reproduce the issue with PnP.PowerShell 1.12.0 using the supplied command; done when the created URL uses contoso-site while the Microsoft 365 Group alias remains contoso.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.