Skip to content

Commit

Permalink
Merge pull request #1973 from gautamdsheth/feature/1972
Browse files Browse the repository at this point in the history
Feature #1972 - additional param to Set-PnPList
  • Loading branch information
KoenZomers authored Jun 14, 2022
2 parents e719bcf + 8935b39 commit 4b51123
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Add-PnPListItemAttachment` cmdlet to provide ability to upload a file as an attachment to a SharePoint list item. [#1932](https://github.com/pnp/powershell/pull/1932)
- Added `Remove-PnPListItemAttachment` cmdlet to provide ability to delete a list item attachment. [#1932](https://github.com/pnp/powershell/pull/1932)
- Added `Get-PnPListItemAttachment` cmdlet to download the attachments from a list item. [#1932](https://github.com/pnp/powershell/pull/1932)
- Added `-ExemptFromBlockDownloadOfNonViewableFiles` parameter to `Set-PnPList` cmdlet to configure access capabilites for unmanaged devices at list level. [#1973](https://github.com/pnp/powershell/pull/1973)
- Added `-PercentComplete`, `-Priority`, `-StartDateTime`, `-DueDateTime` and `-Description` to `Add-PnPPlannerTask` [#1964](https://github.com/pnp/powershell/pull/1964)

### Changed
Expand Down
18 changes: 15 additions & 3 deletions documentation/Set-PnPList.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ Set-PnPList -Identity <ListPipeBind> [-EnableContentTypes <Boolean>] [-BreakRole
[-EnableAttachments <Boolean>] [-EnableFolderCreation <Boolean>] [-EnableVersioning <Boolean>]
[-EnableMinorVersions <Boolean>] [-MajorVersions <UInt32>] [-MinorVersions <UInt32>]
[-EnableModeration <Boolean>] [-ReadSecurity <ListReadSecurity>] [-WriteSecurity <ListWriteSecurity>]
[-NoCrawl] [-Connection <PnPConnection>] [<CommonParameters>]
[-NoCrawl] [-ExemptFromBlockDownloadOfNonViewableFiles <Boolean>] [-Connection <PnPConnection>] [<CommonParameters>]
```

## DESCRIPTION
Allows the configuration of a specific SharePoint Online list to be set.

## EXAMPLES

Expand Down Expand Up @@ -381,9 +382,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -ExemptFromBlockDownloadOfNonViewableFiles
Allows to configure access capabilities for unmanaged devices for the list. If set to $true, the list will be accessible by unmanaged devices as well. For more information, see [SharePoint and OneDrive unmanaged device access controls for administrators](https://docs.microsoft.com/sharepoint/control-access-from-unmanaged-devices).
```yaml
Type: Boolean
Parameter Sets: (All)

## RELATED LINKS
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
## RELATED LINKS
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
11 changes: 10 additions & 1 deletion src/Commands/Lists/SetList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,16 @@ public bool
[Parameter(Mandatory = false)]
public SwitchParameter NoCrawl;

[Parameter(Mandatory = false)]
public bool ExemptFromBlockDownloadOfNonViewableFiles;

protected override void ExecuteCmdlet()
{
var list = Identity.GetList(CurrentWeb);

if (list != null)
{
list.EnsureProperties(l => l.EnableAttachments, l => l.EnableVersioning, l => l.EnableMinorVersions, l => l.Hidden, l => l.EnableModeration, l => l.BaseType, l => l.HasUniqueRoleAssignments, l => l.ContentTypesEnabled);
list.EnsureProperties(l => l.EnableAttachments, l => l.EnableVersioning, l => l.EnableMinorVersions, l => l.Hidden, l => l.EnableModeration, l => l.BaseType, l => l.HasUniqueRoleAssignments, l => l.ContentTypesEnabled, l => l.ExemptFromBlockDownloadOfNonViewableFiles);

var enableVersioning = list.EnableVersioning;
var enableMinorVersions = list.EnableMinorVersions;
Expand Down Expand Up @@ -187,6 +190,12 @@ protected override void ExecuteCmdlet()
updateRequired = true;
}

if (ParameterSpecified(nameof(ExemptFromBlockDownloadOfNonViewableFiles)))
{
list.SetExemptFromBlockDownloadOfNonViewableFiles(ExemptFromBlockDownloadOfNonViewableFiles);
updateRequired = true;
}

if (updateRequired)
{
list.Update();
Expand Down

0 comments on commit 4b51123

Please sign in to comment.