Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Commit 42daa28

Browse files
committed
Throw error on mysite.
1 parent 8ecdaad commit 42daa28

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Commands/Search/SetSearchSettings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ public class SetSearchSettings : PnPWebCmdlet
8787

8888
protected override void ExecuteCmdlet()
8989
{
90+
if(this.ClientContext.Url.ToLower().Contains("-my."))
91+
{
92+
throw new InvalidOperationException("This cmdlet does not work for OneDrive for Business sites");
93+
}
94+
9095
bool hasSearchPageUrl = ParameterSpecified(nameof(SearchPageUrl));
9196
if (hasSearchPageUrl && SearchPageUrl == null)
9297
{

0 commit comments

Comments
 (0)