Skip to content

Commit d3e4006

Browse files
authored
Merge pull request #5042 from reshmee011/HandleError_RSS
Error handling for bug #5036
2 parents 13872aa + 6f8fa80 commit d3e4006

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3535
- Fix `Get-PnPHubSiteChild` cmdlet to handle vanity domains. [#4965](https://github.com/pnp/powershell/pull/4965)
3636
- Fix `Connect-PnPOnline` not working correctly with `-DeviceLogin` in Azure Cloud Shell.
3737
- Fix `Connect-PnPOnline` not working correctly with `-DeviceLogin` in desktop-less environments, such as on a Raspberry Pi [#5058](https://github.com/pnp/powershell/pull/5058)
38+
- Fix `Get-PnPTenantRestrictedSearchMode` throwing an error in some cases [#5042](https://github.com/pnp/powershell/pull/5042)
3839

3940
### Removed
4041

src/Commands/Admin/GetTenantRestrictedSearchMode.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ public class GetTenantRestrictedSearchMode : PnPSharePointOnlineAdminCmdlet
1010
{
1111
protected override void ExecuteCmdlet()
1212
{
13-
var results = Tenant.GetSPORestrictedSearchMode();
14-
AdminContext.ExecuteQueryRetry();
15-
WriteObject(results, true);
13+
try
14+
{
15+
var results = Tenant.GetSPORestrictedSearchMode();
16+
AdminContext.ExecuteQueryRetry();
17+
WriteObject(results, true);
18+
}
19+
catch
20+
{
21+
WriteObject("Restricted search mode is currently not set.");
22+
}
1623
}
1724
}
1825
}

0 commit comments

Comments
 (0)