Skip to content

Commit

Permalink
pnp#2189 - added IsLoopEnabled parametes for tenant cmdlets
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamdsheth committed Sep 1, 2022
1 parent 2af4ab3 commit c669a27
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
42 changes: 42 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,48 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -DisplayNamesOfFileViewers
Allows configuring whether display name of people who view the file are visible in the property pane of the site in OneDrive for business sites.

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

### -DisplayNamesOfFileViewersInSpo
Allows configuring whether display name of people who view the file are visible in the property pane of the site in SharePoint site collection.

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

### -IsLoopEnabled
Allows configuring whether loop components are enabled or disabled in the tenant. If set to `$true`, loop components will be allowed to be created in the tenant. If set to `$false`, it will be disabled in the tenant.

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

### -Force
If provided, no confirmation will be requested and the action will be performed

Expand Down
9 changes: 9 additions & 0 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ public class SetTenant : PnPAdminCmdlet
[Parameter(Mandatory = false)]
public bool? DisplayNamesOfFileViewersInSpo;

[Parameter(Mandatory = false)]
public bool? IsLoopEnabled;

public SwitchParameter Force;

protected override void ExecuteCmdlet()
Expand Down Expand Up @@ -936,6 +939,12 @@ protected override void ExecuteCmdlet()
modified = true;
}

if (IsLoopEnabled.HasValue)
{
Tenant.IsLoopEnabled = IsLoopEnabled.Value;
modified = true;
}

if (modified)
{
ClientContext.ExecuteQueryRetry();
Expand Down
6 changes: 4 additions & 2 deletions src/Commands/Model/SPOTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
this.externalUserExpireInDays = tenant.ExternalUserExpireInDays;
this.displayNamesOfFileViewers = tenant.DisplayNamesOfFileViewers;
this.displayNamesOfFileViewersInSpo = tenant.DisplayNamesOfFileViewersInSpo;

this.isLoopEnabled = tenant.IsLoopEnabled;
try
{
this.enableGuestSignInAcceleration = tenant.EnableGuestSignInAcceleration;
Expand Down Expand Up @@ -557,7 +557,7 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
public bool DisplayNamesOfFileViewers => displayNamesOfFileViewers;

public bool DisplayNamesOfFileViewersInSpo => displayNamesOfFileViewersInSpo;

public bool IsLoopEnabled => isLoopEnabled;
public Guid[] DisabledModernListTemplateIds => disabledModernListTemplateIds;

private bool hideDefaultThemes;
Expand Down Expand Up @@ -720,5 +720,7 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)

private bool displayNamesOfFileViewersInSpo;

private bool isLoopEnabled;

}
}

0 comments on commit c669a27

Please sign in to comment.