Skip to content

Commit

Permalink
add additonal properties RequestFilesLinkExpirationInDays,RequestFile…
Browse files Browse the repository at this point in the history
…sLinkEnabled and OverrideSharingCapability
  • Loading branch information
reshmee011 committed Aug 25, 2024
1 parent 194e08f commit 4efbca1
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 1 deletion.
49 changes: 48 additions & 1 deletion documentation/Set-PnPTenantSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ Set-PnPTenantSite [-Identity] <String> [-Title <String>] [-LocaleId <UInt32>] [-
[-DefaultLinkToExistingAccessReset <SwitchParameter>] [-DefaultShareLinkRole <Role>]
[-DefaultShareLinkScope <SharingScope>] [-LoopDefaultSharingLinkRole <Role>]
[-LoopDefaultSharingLinkScope <SharingScope>] [-RestrictContentOrgWideSearch <Boolean>] [-ReadOnlyForUnmanagedDevices <Boolean>]
[-InheritVersionPolicyFromTenant <SwitchParameter>]
[-RequestFilesLinkExpirationInDays <Int32>] [-RequestFilesLinkEnabled <Boolean>] [-OverrideSharingCapability <Boolean>]
[-RestrictedAccessControl <Boolean>] [-ClearRestrictedAccessControl <SwitchParameter>] [-RestrictedAccessControlGroups <Guid[]>]
[-AddRestrictedAccessControlGroups <Guid[]>] [-RemoveRestrictedAccessControlGroups <Guid[]>][-InheritVersionPolicyFromTenant <SwitchParameter>]
[-Wait]
[-Connection <PnPConnection>]
```
Expand Down Expand Up @@ -940,6 +942,51 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -RequestFilesLinkExpirationInDays
Specifies the number of days after which the request files link will expire.
The value can be from 0 to 730 days.

```yaml
Type: Int32
Parameter Sets: Set Properties
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```


### -OverrideSharingCapability
Specifies whether to override the sharing capability for the site.

```yaml
Type: Boolean
Parameter Sets: Set Properties
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -RequestFilesLinkEnabled
Enables or disables the Request Files link on the site.

```yaml
Type: Boolean
Parameter Sets: Set Properties
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```


### -Wait
Wait for the operation to complete

Expand Down
27 changes: 27 additions & 0 deletions src/Commands/Admin/SetTenantSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ public class SetTenantSite : PnPAdminCmdlet
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public SwitchParameter InheritVersionPolicyFromTenant;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public bool OverrideSharingCapability;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public int RequestFilesLinkExpirationInDays;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public bool RequestFilesLinkEnabled;

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

Expand Down Expand Up @@ -641,6 +650,24 @@ private void SetSiteProperties(Func<TenantOperationMessage, bool> timeoutFunctio
updateRequired = true;
}

if (ParameterSpecified(nameof(OverrideSharingCapability)))
{
props.ReadOnlyForUnmanagedDevices = OverrideSharingCapability;
updateRequired = true;
}

if (ParameterSpecified(nameof(RequestFilesLinkExpirationInDays)))
{
props.RequestFilesLinkExpirationInDays = RequestFilesLinkExpirationInDays;
updateRequired = true;
}

if (ParameterSpecified(nameof(RequestFilesLinkEnabled)))
{
props.RequestFilesLinkEnabled = RequestFilesLinkEnabled;
updateRequired = true;
}

if (updateRequired)
{
var op = props.Update();
Expand Down
4 changes: 4 additions & 0 deletions src/Commands/Model/SPOSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public class SPOSite
public bool SetOwnerWithoutUpdatingSecondaryAdmin { get; set; }
public bool RestrictContentOrgWideSearch { get; set; }
public bool ReadOnlyForUnmanagedDevices { get; set; }
public SiteUserInfoVisibilityPolicyValue OverrideBlockUserInfoVisibility { get; set; }
public bool OverrideSharingCapability { get; set; }

#endregion


Expand Down Expand Up @@ -192,6 +195,7 @@ public SPOSite(SiteProperties props, bool? disableSharingForNonOwnersStatus)
SetOwnerWithoutUpdatingSecondaryAdmin = props.SetOwnerWithoutUpdatingSecondaryAdmin;
RestrictContentOrgWideSearch = props.RestrictContentOrgWideSearch;
ReadOnlyForUnmanagedDevices = props.ReadOnlyForUnmanagedDevices;
OverrideSharingCapability = props.OverrideSharingCapability;
}
}
}

0 comments on commit 4efbca1

Please sign in to comment.