Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions documentation/Get-PnPHomeSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ Get-PnPHomeSite

Returns the home site url for your tenant

### EXAMPLE 2
```powershell
Get-PnPHomeSite -IsVivaConnectionsDefaultStartForCompanyPortalSiteEnabled
```

Returns whether Viva Connections landing experience is set to the SharePoint home site.

## PARAMETERS

### -Connection
Expand All @@ -50,6 +57,19 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -IsVivaConnectionsDefaultStartForCompanyPortalSiteEnabled
When specified, it retrieves whether Viva Connections landing experience is set to the SharePoint home site.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
Expand Down
21 changes: 21 additions & 0 deletions documentation/Set-PnPHomeSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ Set-PnPHomeSite -HomeSiteUrl "https://yourtenant.sharepoint.com/sites/myhome"

Sets the home site to the provided site collection url

### EXAMPLE 2
```powershell
Set-PnPHomeSite -HomeSiteUrl "https://yourtenant.sharepoint.com/sites/myhome" -VivaConnectionsDefaultStart:$true
```

Sets the home site to the provided site collection url and keeps the Viva Connections landing experience to the SharePoint home site.

## PARAMETERS

### -Connection
Expand Down Expand Up @@ -66,7 +73,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -VivaConnectionsDefaultStart
When set to $true, the VivaConnectionsDefaultStart parameter will keep the Viva Connections landing experience to the SharePoint home site. If set to $false the Viva Connections home experience will be used.

```yaml
Type: Boolean
Parameter Sets: (All)
Required: False
Position: Named
Default value: true
Accept pipeline input: False
Accept wildcard characters: False
```

## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
[Set up a home site for your organization](https://learn.microsoft.com/sharepoint/home-site)
[Customize and edit the Viva Connections home experience](https://learn.microsoft.com/en-us/viva/connections/edit-viva-home)
22 changes: 18 additions & 4 deletions src/Commands/Admin/GetHomeSite.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.SharePoint.Client;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
Expand All @@ -8,11 +9,24 @@ namespace PnP.PowerShell.Commands.Admin
[Cmdlet(VerbsCommon.Get, "PnPHomeSite")]
public class GetHomeSite : PnPAdminCmdlet
{
[Parameter(Mandatory = false)]
public SwitchParameter IsVivaConnectionsDefaultStartForCompanyPortalSiteEnabled;
protected override void ExecuteCmdlet()
{
var results = Tenant.GetSPHSiteUrl();
ClientContext.ExecuteQueryRetry();
WriteObject(results.Value);
if (ParameterSpecified(nameof(IsVivaConnectionsDefaultStartForCompanyPortalSiteEnabled)))
{
var results = Tenant.IsVivaConnectionsDefaultStartForCompanyPortalSiteEnabled();
ClientContext.ExecuteQueryRetry();
WriteObject(results.Value);
}
else
{
var results = Tenant.GetSPHSiteUrl();
ClientContext.ExecuteQueryRetry();
WriteObject(results.Value);
}


}
}
}
12 changes: 11 additions & 1 deletion src/Commands/Admin/SetHomeSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@ public class SetHomeSite : PnPAdminCmdlet
[Parameter(Mandatory = true)]
public string HomeSiteUrl;

[Parameter(Mandatory = false)]
public SwitchParameter VivaConnectionsDefaultStart;

protected override void ExecuteCmdlet()
{
Tenant.SetSPHSite(HomeSiteUrl);
if (ParameterSpecified(nameof(VivaConnectionsDefaultStart)))
{
Tenant.SetSPHSiteWithConfigurations(HomeSiteUrl, VivaConnectionsDefaultStart);
}
else
{
Tenant.SetSPHSite(HomeSiteUrl);
}
ClientContext.ExecuteQueryRetry();
}
}
Expand Down