Add-PnPHubSiteAssociation

Tip

We encourage you to make improvements to this documentation. Please navigate to https://github.com/pnp/powershell/blob/dev/documentation/Add-PnPHubSiteAssociation.md to change this file.

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Connects a site to a hubsite.

Syntax

Add-PnPHubSiteAssociation
   -Site <SitePipeBind>
   -HubSite <SitePipeBind>
   [-Connection <PnPConnection>]
   [<CommonParameters>]

Description

Connects an existing site to a hubsite

Examples

EXAMPLE 1

Add-PnPHubSiteAssociation -Site "https://tenant.sharepoint.com/sites/mysite" -HubSite "https://tenant.sharepoint.com/sites/hubsite"

This example adds the specified site to the hubsite.

Parameters

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:PnPConnection
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HubSite

The hubsite to connect the site to

Type:SitePipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Site

The site to connect to the hubsite

Type:SitePipeBind
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False