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

Commit 78b6f3e

Browse files
Merge pull request #1959 from erwinvanhunen/dev
fixed compilation issue for 2013 and 2016
2 parents f81aab7 + 0435038 commit 78b6f3e

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Commands/Base/PipeBinds/AlertPipeBind.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ public AlertPipeBind()
3131
}
3232
}
3333
}
34+
#endif

Commands/Files/GetFile.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ protected override void ExecuteCmdlet()
158158

159159
private void SaveFileToLocal(Web web, string serverRelativeUrl, string localPath, string localFileName = null, Func<string, bool> fileExistsCallBack = null)
160160
{
161+
162+
#if SP2013 || SP2016
163+
var file = web.GetFileByServerRelativeUrl(serverRelativeUrl);
164+
#else
161165
var file = web.GetFileByServerRelativePath(ResourcePath.FromDecodedUrl(serverRelativeUrl));
166+
#endif
162167

163168
var clientContext = web.Context as ClientContext;
164169
clientContext.Load(file);

Commands/Provisioning/Site/AddFileToProvisioningTemplate.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ protected override void ProcessRecord()
9898
if (ClientContext.HasPendingRequest) ClientContext.ExecuteQuery();
9999
try
100100
{
101+
#if SP2013 || SP2016
102+
var fi = SelectedWeb.GetFileByServerRelativeUrl(serverRelativeUrl);
103+
#else
101104
var fi = SelectedWeb.GetFileByServerRelativePath(ResourcePath.FromDecodedUrl(serverRelativeUrl));
105+
#endif
102106
var fileStream = fi.OpenBinaryStream();
103107
ClientContext.ExecuteQueryRetry();
104108
using (var ms = fileStream.Value)

0 commit comments

Comments
 (0)