Skip to content

Commit 5abae72

Browse files
author
Gary Lapointe
committed
SP2016 changes.
1 parent 52749ac commit 5abae72

File tree

14 files changed

+10389
-9611
lines changed

14 files changed

+10389
-9611
lines changed

Build-WSPs.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ mkdir $outDir -Force | Out-Null
2525
$projects = @{
2626
"$solutionFolder\Lapointe.SharePoint2010.PowerShell\Lapointe.SharePoint2010.PowerShell.csproj" = @("ReleaseMOSS", "ReleaseFoundation")
2727
"$solutionFolder\Lapointe.SharePoint2013.PowerShell\Lapointe.SharePoint2013.PowerShell.csproj" = @("ReleaseMOSS", "ReleaseFoundation")
28+
"$solutionFolder\Lapointe.SharePoint2016.PowerShell\Lapointe.SharePoint2016.PowerShell.csproj" = @("ReleaseMOSS")
2829
}
2930
foreach ($project in $projects.Keys) {
3031
Write-Host "Building $project..." -ForegroundColor Blue
3132
foreach ($config in $projects[$project]) {
3233
$version = "SP2010"
3334
if ($project.Contains("Lapointe.SharePoint2013.PowerShell.csproj")) { $version = "SP2013" }
35+
elseif ($project.Contains("Lapointe.SharePoint2016.PowerShell.csproj")) { $version = "SP2016" }
3436
Write-Host "Building $config..." -ForegroundColor Blue
3537
del "$outDir\$version\$config\*.wsp" -Force -ErrorAction SilentlyContinue
3638
&$msbuild $project /v:m /t:Rebuild /t:Package /p:Configuration="$config" /p:OutDir="$outDir\$version\$config"

Lapointe.SharePoint2010.PowerShell/Cmdlets/SiteCollections/SPCmdletRepairSite.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Lapointe.SharePoint.PowerShell.Cmdlets.SiteCollections
2121
[CmdletDescription("Repair a site collection that was created using the export of a web.")]
2222
[Example(Code = "PS C:\\> Get-SPSite http://portal/sites/newsitecoll | Repair-SPSite -SourceSite \"http://portal/\"",
2323
Remarks = "This example repairs the site collection located at http://portal/sites/newsitecoll using the site collection http://portal as the model site for the repairs.")]
24-
#elif SP2013
24+
#else
2525
[Cmdlet("Repair", "SPMigratedSite", SupportsShouldProcess = false),
2626
SPCmdlet(RequireLocalFarmExist = true, RequireUserMachineAdmin = false, RequireUserFarmAdmin = true)]
2727
[CmdletDescription("Repair a site collection that was created using the export of a web. This cmdlet is the equivalent to the SharePoint 2010 Repair-SPSite cmdlet - it was renamed because SharePoint 2013 introduced a Repair-SPSite cmdlet which does different things.")]

Lapointe.SharePoint2010.PowerShell/Cmdlets/WebParts/SPCmdletAddListViewWebPart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public class SPCmdletAddListViewWebPart : SPNewCmdletBaseCustom<Microsoft.ShareP
131131
HelpMessage = "Add some space before the web part.")]
132132
public SwitchParameter AddSpace { get; set; }
133133

134-
#if SP2013
134+
#if !SP2010
135135
[Parameter(
136136
Position = 12,
137137
Mandatory = false,

Lapointe.SharePoint2010.PowerShell/Common/ManagedMetadata/ExportTerms.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private XmlElement AddTermSetElement(XmlElement parent, TermSet termSet)
149149
element.SetAttribute("IsOpenForTermCreation", termSet.IsOpenForTermCreation.ToString());
150150
element.SetAttribute("CustomSortOrder", termSet.CustomSortOrder);
151151

152-
#if SP2013
152+
#if !SP2010
153153
// Updated provided by John Calvert
154154
XmlElement propertiesElement = _xml.CreateElement("CustomProperties");
155155
element.AppendChild(propertiesElement);
@@ -235,7 +235,7 @@ private XmlElement AddTermElement(XmlElement parent, Term term)
235235
propertyElement.SetAttribute("Value", term.CustomProperties[key]);
236236
}
237237

238-
#if SP2013
238+
#if !SP2010
239239
// Updated provided by John Calvert
240240
XmlElement localpropertiesElement = _xml.CreateElement("LocalCustomProperties");
241241
element.AppendChild(localpropertiesElement);

Lapointe.SharePoint2010.PowerShell/Common/ManagedMetadata/ImportTerms.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ private void Import(XmlElement termSetElement, Group parentGroup)
292292
termSet.IsOpenForTermCreation = true;
293293
}
294294

295-
#if SP2013
295+
#if !SP2010
296296
// Updated provided by John Calvert
297297
XmlNodeList propertyNodes = termSetElement.SelectNodes("./CustomProperties/CustomProperty");
298298
if (propertyNodes != null && propertyNodes.Count > 0)
@@ -401,7 +401,7 @@ private void Import(XmlElement termElement, TermSetItem parentTermSetItem)
401401
}
402402
}
403403

404-
#if SP2013
404+
#if !SP2010
405405
// Updated provided by John Calvert
406406
XmlNodeList localpropertyNodes = termElement.SelectNodes("./LocalCustomProperties/LocalCustomProperty");
407407
if (localpropertyNodes != null && localpropertyNodes.Count > 0)

Lapointe.SharePoint2010.PowerShell/Common/WebParts/AddListViewWebPart.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static Microsoft.SharePoint.WebPartPages.WebPart Add(string pageUrl, stri
7979
else
8080
{
8181
((XsltListViewWebPart)lvw).ListName = list.ID.ToString("B").ToUpperInvariant();
82-
#if SP2013
82+
#if !SP2010
8383
if (!string.IsNullOrEmpty(jsLink))
8484
((XsltListViewWebPart)lvw).JSLink = jsLink;
8585
#endif
@@ -182,7 +182,7 @@ public static Microsoft.SharePoint.WebPartPages.WebPart AddToWikiPage(string pag
182182
else
183183
{
184184
((XsltListViewWebPart)lvw).ListName = list.ID.ToString("B").ToUpperInvariant();
185-
#if SP2013
185+
#if !SP2010
186186
if (!string.IsNullOrEmpty(jsLink))
187187
((XsltListViewWebPart)lvw).JSLink = jsLink;
188188
#endif
Binary file not shown.

Lapointe.SharePoint2010.PowerShell/StsAdm/ContentDatabases/CreateContentDB.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public override int Execute(string command, StringDictionary keyValues, out stri
9999
// matching search server using the server address property.
100100
#if SP2010
101101
SPSearchService service = SPFarm.Local.Services.GetValue<SPSearchService>("SPSearch");
102-
#elif SP2013
102+
#else
103103
SPSearchService service = SPFarm.Local.Services.GetValue<SPSearchService>("SPSearch4");
104104
#endif
105105
SPServiceInstance searchServiceServer = null;

Lapointe.SharePoint2010.PowerShell/StsAdm/ContentDatabases/ManageContentDBSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Microsoft.SharePoint.Administration;
77
#if SP2010
88
using Microsoft.SharePoint.Search.Administration;
9-
#elif SP2013
9+
#else
1010
using Microsoft.SharePoint.Search.Administration;
1111
#endif
1212
using Lapointe.SharePoint.PowerShell.StsAdm.SPValidators;
@@ -120,7 +120,7 @@ public override int Execute(string command, StringDictionary keyValues, out stri
120120
// matching search server using the server address property.
121121
#if SP2010
122122
SPSearchService service = SPFarm.Local.Services.GetValue<SPSearchService>("SPSearch");
123-
#elif SP2013
123+
#else
124124
SPSearchService service = SPFarm.Local.Services.GetValue<SPSearchService>("SPSearch4");
125125
#endif
126126
SPServiceInstance searchServiceServer = null;

Lapointe.SharePoint2010.PowerShell/Utilities.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ public static string GetGenericSetupPath(string subDir)
5656
{
5757
#if SP2010
5858
return GetGenericSetupPath(subDir, 14);
59-
#elif SP2013
59+
#else
6060
return GetGenericSetupPath(subDir, 15);
6161
#endif
6262
}
6363
public static string GetGenericSetupPath(string subDir, int desiredVersion)
6464
{
6565
#if SP2010
6666
return SPUtility.GetGenericSetupPath(subDir);
67-
#elif SP2013
67+
#else
6868
return SPUtility.GetVersionedGenericSetupPath(subDir, desiredVersion);
6969
#endif
7070
}

0 commit comments

Comments
 (0)