Skip to content

Commit c793e49

Browse files
authored
Merge pull request #3233 from gautamdsheth/feature/add-ListsShowHeaderAndNavigation-param
Feature: add ListsShowHeaderAndNavigation property to PnPTenantSite and PnPSite cmdlets
2 parents cc7fc92 + 9dc7581 commit c793e49

File tree

5 files changed

+51
-2
lines changed

5 files changed

+51
-2
lines changed

documentation/Set-PnPSite.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Set-PnPSite [-Identity <String>]
4646
[-ScriptSafeDomainName <string>]
4747
[-BlockDownloadPolicy <Boolean>] [-ExcludeBlockDownloadPolicySiteOwners <Boolean>]
4848
[-ExcludedBlockDownloadGroupIds <Guid[]>]
49+
[-ListsShowHeaderAndNavigation <Boolean>]
4950
[-Connection <PnPConnection>]
5051
```
5152

@@ -584,6 +585,20 @@ Accept pipeline input: False
584585
Accept wildcard characters: False
585586
```
586587
588+
### -ListsShowHeaderAndNavigation
589+
Set a property on a site collection to make all lists always load with the site elements intact.
590+
591+
```yaml
592+
Type: Boolean
593+
Parameter Sets: Set Properties
594+
595+
Required: False
596+
Position: Named
597+
Default value: None
598+
Accept pipeline input: False
599+
Accept wildcard characters: False
600+
```
601+
587602
### -Wait
588603
Wait for the operation to complete
589604

documentation/Set-PnPTenantSite.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Set-PnPTenantSite [-Identity] <String> [-Title <String>] [-LocaleId <UInt32>] [-
3636
[-MediaTranscription <MediaTranscriptionPolicyType>]
3737
[-BlockDownloadPolicy <Boolean>] [-ExcludeBlockDownloadPolicySiteOwners <Boolean>]
3838
[-ExcludedBlockDownloadGroupIds <Guid[]>]
39+
[-ListsShowHeaderAndNavigation <Boolean>]
3940
[-Wait]
4041
[-Connection <PnPConnection>]
4142
```
@@ -722,6 +723,20 @@ Accept pipeline input: False
722723
Accept wildcard characters: False
723724
```
724725

726+
### -ListsShowHeaderAndNavigation
727+
Set a property on a site collection to make all lists always load with the site elements intact.
728+
729+
```yaml
730+
Type: Boolean
731+
Parameter Sets: Set Properties
732+
733+
Required: False
734+
Position: Named
735+
Default value: None
736+
Accept pipeline input: False
737+
Accept wildcard characters: False
738+
```
739+
725740
### -Wait
726741
Wait for the operation to complete
727742

src/Commands/Admin/SetTenantSite.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ public class SetTenantSite : PnPAdminCmdlet
174174
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
175175
public Guid[] ExcludedBlockDownloadGroupIds;
176176

177+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
178+
public bool? ListsShowHeaderAndNavigation;
179+
177180
[Parameter(Mandatory = false)]
178181
public SwitchParameter Wait;
179182

@@ -528,6 +531,12 @@ private void SetSiteProperties(Func<TenantOperationMessage, bool> timeoutFunctio
528531
updateRequired = true;
529532
}
530533

534+
if (ParameterSpecified(nameof(ListsShowHeaderAndNavigation)) && ListsShowHeaderAndNavigation.HasValue)
535+
{
536+
props.ListsShowHeaderAndNavigation = ListsShowHeaderAndNavigation.Value;
537+
updateRequired = true;
538+
}
539+
531540
if (updateRequired)
532541
{
533542
var op = props.Update();

src/Commands/Base/ConnectOnline.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ private static bool PingHost(string nameOrAddress)
723723
}
724724
return false;
725725
}
726-
catch(Exception ex)
726+
catch
727727
{
728728
return false;
729729
}

src/Commands/Site/SetSite.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ public class SetSite : PnPSharePointCmdlet
121121
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
122122
public Guid[] ExcludedBlockDownloadGroupIds;
123123

124+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
125+
public bool? ListsShowHeaderAndNavigation;
126+
124127
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_LOCKSTATE)]
125128
public SwitchParameter Wait;
126129

@@ -397,6 +400,12 @@ protected override void ExecuteCmdlet()
397400
executeQueryRequired = true;
398401
}
399402

403+
if (ParameterSpecified(nameof(ListsShowHeaderAndNavigation)) && ListsShowHeaderAndNavigation.HasValue)
404+
{
405+
siteProperties.ListsShowHeaderAndNavigation = ListsShowHeaderAndNavigation.Value;
406+
executeQueryRequired = true;
407+
}
408+
400409
if (executeQueryRequired)
401410
{
402411
siteProperties.Update();
@@ -451,6 +460,7 @@ private bool IsTenantProperty() =>
451460
RequestFilesLinkEnabled.HasValue ||
452461
BlockDownloadPolicy.HasValue ||
453462
ExcludeBlockDownloadPolicySiteOwners.HasValue ||
454-
ParameterSpecified(nameof(ExcludedBlockDownloadGroupIds));
463+
ParameterSpecified(nameof(ExcludedBlockDownloadGroupIds)) ||
464+
ListsShowHeaderAndNavigation.HasValue;
455465
}
456466
}

0 commit comments

Comments
 (0)