Skip to content

Commit

Permalink
SP2016 changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Lapointe committed Jun 17, 2016
1 parent 52749ac commit 5abae72
Show file tree
Hide file tree
Showing 14 changed files with 10,389 additions and 9,611 deletions.
2 changes: 2 additions & 0 deletions Build-WSPs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ mkdir $outDir -Force | Out-Null
$projects = @{
"$solutionFolder\Lapointe.SharePoint2010.PowerShell\Lapointe.SharePoint2010.PowerShell.csproj" = @("ReleaseMOSS", "ReleaseFoundation")
"$solutionFolder\Lapointe.SharePoint2013.PowerShell\Lapointe.SharePoint2013.PowerShell.csproj" = @("ReleaseMOSS", "ReleaseFoundation")
"$solutionFolder\Lapointe.SharePoint2016.PowerShell\Lapointe.SharePoint2016.PowerShell.csproj" = @("ReleaseMOSS")
}
foreach ($project in $projects.Keys) {
Write-Host "Building $project..." -ForegroundColor Blue
foreach ($config in $projects[$project]) {
$version = "SP2010"
if ($project.Contains("Lapointe.SharePoint2013.PowerShell.csproj")) { $version = "SP2013" }
elseif ($project.Contains("Lapointe.SharePoint2016.PowerShell.csproj")) { $version = "SP2016" }
Write-Host "Building $config..." -ForegroundColor Blue
del "$outDir\$version\$config\*.wsp" -Force -ErrorAction SilentlyContinue
&$msbuild $project /v:m /t:Rebuild /t:Package /p:Configuration="$config" /p:OutDir="$outDir\$version\$config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Lapointe.SharePoint.PowerShell.Cmdlets.SiteCollections
[CmdletDescription("Repair a site collection that was created using the export of a web.")]
[Example(Code = "PS C:\\> Get-SPSite http://portal/sites/newsitecoll | Repair-SPSite -SourceSite \"http://portal/\"",
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.")]
#elif SP2013
#else
[Cmdlet("Repair", "SPMigratedSite", SupportsShouldProcess = false),
SPCmdlet(RequireLocalFarmExist = true, RequireUserMachineAdmin = false, RequireUserFarmAdmin = true)]
[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.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class SPCmdletAddListViewWebPart : SPNewCmdletBaseCustom<Microsoft.ShareP
HelpMessage = "Add some space before the web part.")]
public SwitchParameter AddSpace { get; set; }

#if SP2013
#if !SP2010
[Parameter(
Position = 12,
Mandatory = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private XmlElement AddTermSetElement(XmlElement parent, TermSet termSet)
element.SetAttribute("IsOpenForTermCreation", termSet.IsOpenForTermCreation.ToString());
element.SetAttribute("CustomSortOrder", termSet.CustomSortOrder);

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

#if SP2013
#if !SP2010
// Updated provided by John Calvert
XmlElement localpropertiesElement = _xml.CreateElement("LocalCustomProperties");
element.AppendChild(localpropertiesElement);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ private void Import(XmlElement termSetElement, Group parentGroup)
termSet.IsOpenForTermCreation = true;
}

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

#if SP2013
#if !SP2010
// Updated provided by John Calvert
XmlNodeList localpropertyNodes = termElement.SelectNodes("./LocalCustomProperties/LocalCustomProperty");
if (localpropertyNodes != null && localpropertyNodes.Count > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static Microsoft.SharePoint.WebPartPages.WebPart Add(string pageUrl, stri
else
{
((XsltListViewWebPart)lvw).ListName = list.ID.ToString("B").ToUpperInvariant();
#if SP2013
#if !SP2010
if (!string.IsNullOrEmpty(jsLink))
((XsltListViewWebPart)lvw).JSLink = jsLink;
#endif
Expand Down Expand Up @@ -182,7 +182,7 @@ public static Microsoft.SharePoint.WebPartPages.WebPart AddToWikiPage(string pag
else
{
((XsltListViewWebPart)lvw).ListName = list.ID.ToString("B").ToUpperInvariant();
#if SP2013
#if !SP2010
if (!string.IsNullOrEmpty(jsLink))
((XsltListViewWebPart)lvw).JSLink = jsLink;
#endif
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public override int Execute(string command, StringDictionary keyValues, out stri
// matching search server using the server address property.
#if SP2010
SPSearchService service = SPFarm.Local.Services.GetValue<SPSearchService>("SPSearch");
#elif SP2013
#else
SPSearchService service = SPFarm.Local.Services.GetValue<SPSearchService>("SPSearch4");
#endif
SPServiceInstance searchServiceServer = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.SharePoint.Administration;
#if SP2010
using Microsoft.SharePoint.Search.Administration;
#elif SP2013
#else
using Microsoft.SharePoint.Search.Administration;
#endif
using Lapointe.SharePoint.PowerShell.StsAdm.SPValidators;
Expand Down Expand Up @@ -120,7 +120,7 @@ public override int Execute(string command, StringDictionary keyValues, out stri
// matching search server using the server address property.
#if SP2010
SPSearchService service = SPFarm.Local.Services.GetValue<SPSearchService>("SPSearch");
#elif SP2013
#else
SPSearchService service = SPFarm.Local.Services.GetValue<SPSearchService>("SPSearch4");
#endif
SPServiceInstance searchServiceServer = null;
Expand Down
4 changes: 2 additions & 2 deletions Lapointe.SharePoint2010.PowerShell/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public static string GetGenericSetupPath(string subDir)
{
#if SP2010
return GetGenericSetupPath(subDir, 14);
#elif SP2013
#else
return GetGenericSetupPath(subDir, 15);
#endif
}
public static string GetGenericSetupPath(string subDir, int desiredVersion)
{
#if SP2010
return SPUtility.GetGenericSetupPath(subDir);
#elif SP2013
#else
return SPUtility.GetVersionedGenericSetupPath(subDir, desiredVersion);
#endif
}
Expand Down
Loading

0 comments on commit 5abae72

Please sign in to comment.