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

Commit 1c0c66b

Browse files
committed
Set default connection type aligned to the target binary type
1 parent 68c344c commit 1c0c66b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Commands/Base/SPOnlineConnectionHelper.cs

+5
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,16 @@ internal static SPOnlineConnection InstantiateSPOnlineConnection(Uri url, PSCred
563563
context.Credentials = new NetworkCredential(credentials.UserName, credentials.Password);
564564
}
565565
}
566+
#if SP2013 || SP2016 || SP2019
566567
var connectionType = ConnectionType.OnPrem;
568+
#else
569+
var connectionType = ConnectionType.O365;
570+
#endif
567571
if (url.Host.ToUpperInvariant().EndsWith("SHAREPOINT.COM"))
568572
{
569573
connectionType = ConnectionType.O365;
570574
}
575+
571576
if (skipAdminCheck == false)
572577
{
573578
if (IsTenantAdminSite(context))

0 commit comments

Comments
 (0)