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

Commit

Permalink
Merge pull request #1728 from SharePoint/dev
Browse files Browse the repository at this point in the history
October 2018 release
  • Loading branch information
erwinvanhunen committed Oct 9, 2018
2 parents 25a8101 + c892448 commit 7ed8ba9
Show file tree
Hide file tree
Showing 39 changed files with 1,889 additions and 169 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,8 +7,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [3.2.1810.0] Unreleased
### Added
- Add-PnPProvisioningSequence : Adds an in-memory sequence to an in-memory provisioning hierarchy
- Add-PnPProvisioningSite : Adds an in-memory site definition to a in-memory sequence
- Add-PnPProvisioningSubSite : Adds an in-memory sub site defintion to an in-memory site
- Apply-PnPProvisioningHierarchy : Applies a provisioninghierarchy with a site sequence to a tenant
- Get-PnPProvisioningSite : Returns a site as an in-memory object from a given provisioning hierarchy
- New-PnPProvisioningHierarchy : Creates a new in-memory provisioning hierarchy
- New-PnPProvisioningSequence : Creates a new in-memory provisioning sequence
- New-PnPProvisioningCommunicationSite : Creates a new in-memory communication site definition
- New-PnPProvisioningTeamNoGroupSite : Creates a new in-memory team site definition which has no associated office365 group
- New-PnPProvisioningTeamNoGroupSubSite : Creates a new in-memory team sub site definition which has no associated office365 group
- New-PnPProvisioningTeamSite : Creates a new in-memory team site definition
- Read-PnPProvisioningHierarchy : Reads an existing (file based) provisioning hierarchy into an in-memory instance
- Save-PnPProvisioningHierarchy : Saves an in-memory provisioning hierarchy to a pnp file
- Test-PnPProvisioningHierarchy : Tests an in-memory hierarchy if all template references are correct in the site sequence
- Get-PnPException : Returns the last occured exception that occured while using PowerShell.

### Changed
- Updated Set-PnPSite to allow for setting of a logo on modern team site
- Updated Get-PnPTerm to allow for -IncludeChildTerms parameter, which will load, if available all child terms
- Updated Get-PnPTerm to allow for only specifying the id of a termset, without needing to require to specify the termset and termgroup.

### Deprecated

Expand Down
4 changes: 2 additions & 2 deletions Commands/Admin/GetHubSite.cs
Expand Up @@ -13,8 +13,8 @@ namespace SharePointPnP.PowerShell.Commands.Admin
[CmdletHelp(@"Retrieve all or a specific hubsite.",
Category = CmdletHelpCategory.TenantAdmin,
SupportedPlatform = CmdletSupportedPlatform.Online)]
[CmdletExample(Code = @"PS:> Get-PnPStorageEntity", Remarks = "Returns all site storage entities/farm properties", SortOrder = 1)]
[CmdletExample(Code = @"PS:> Get-PnPTenantSite -Key MyKey", Remarks = "Returns the storage entity/farm property with the given key.", SortOrder = 2)]
[CmdletExample(Code = @"PS:> Get-PnPHubSite", Remarks = "Returns all hubsite properties", SortOrder = 1)]
[CmdletExample(Code = @"PS:> Get-PnPHubSite -Identity https://contoso.sharepoint.com/sites/myhubsite", Remarks = "Returns the properties of the specified hubsite", SortOrder = 2)]
public class GetHubSite : PnPAdminCmdlet
{
[Parameter(Position = 0, ValueFromPipeline = true)]
Expand Down
48 changes: 48 additions & 0 deletions Commands/Base/GetException.cs
@@ -0,0 +1,48 @@
using SharePointPnP.PowerShell.CmdletHelpAttributes;
using SharePointPnP.PowerShell.Commands.Model;
using System.Collections;
using System.Collections.Generic;
using System.Management.Automation;

namespace SharePointPnP.PowerShell.Commands.Base
{
[Cmdlet(VerbsCommon.Get, "PnPException")]
[CmdletHelp("Returns the last exception that occured",
@"Returns the last exception which can be used while debugging PnP Cmdlets",
Category = CmdletHelpCategory.Base)]
[CmdletExample(
Code = @"PS:> Get-PnPException",
Remarks = "Returns the last exception",
SortOrder = 1)]
[CmdletExample(
Code = @"PS:> Get-PnPException -All",
Remarks = "Returns all exceptions that occurred",
SortOrder = 2)]
public class GetException : PSCmdlet
{
[Parameter(Mandatory = false, HelpMessage = "Show all exceptions")]
public SwitchParameter All;

protected override void ProcessRecord()
{
var exceptions = (ArrayList)this.SessionState.PSVariable.Get("error").Value;
if (exceptions.Count > 0)
{
var output = new List<PnPException>();
if (All.IsPresent)
{
foreach (ErrorRecord exception in exceptions)
{
output.Add(new PnPException() { Message = exception.Exception.Message, Stacktrace = exception.Exception.StackTrace, ScriptLineNumber = exception.InvocationInfo.ScriptLineNumber, InvocationInfo = exception.InvocationInfo });
}
}
else
{
var exception = (ErrorRecord)exceptions[0];
output.Add(new PnPException() { Message = exception.Exception.Message, Stacktrace = exception.Exception.StackTrace, ScriptLineNumber = exception.InvocationInfo.ScriptLineNumber, InvocationInfo = exception.InvocationInfo });
}
WriteObject(output, true);
}
}
}
}
36 changes: 36 additions & 0 deletions Commands/Base/PipeBinds/ProvisioningSequencePipebind.cs
@@ -0,0 +1,36 @@
using OfficeDevPnP.Core.Framework.Provisioning.Model;
using System;
using System.Linq;

namespace SharePointPnP.PowerShell.Commands.Base.PipeBinds
{
public sealed class ProvisioningSequencePipeBind
{
private readonly ProvisioningSequence _sequence;
private readonly string _identity;

public ProvisioningSequencePipeBind(ProvisioningSequence sequence)
{
_sequence = sequence;
}

public ProvisioningSequencePipeBind(string identity)
{
_identity = identity;
}

public ProvisioningSequence GetSequenceFromHierarchy(ProvisioningHierarchy hierarchy)
{
var id = string.Empty;
if(_sequence == null)
{
id = _identity;
} else
{
id = _sequence.ID;
}
return hierarchy.Sequences.FirstOrDefault(s => s.ID == id);
}

}
}
35 changes: 35 additions & 0 deletions Commands/Base/PipeBinds/ProvisioningSitePipeBind.cs
@@ -0,0 +1,35 @@
using OfficeDevPnP.Core.Framework.Provisioning.Model;
using System;
using System.Linq;

namespace SharePointPnP.PowerShell.Commands.Base.PipeBinds
{
public sealed class ProvisioningSitePipeBind
{
private readonly SiteCollection _site;

public ProvisioningSitePipeBind(TeamSiteCollection site)
{
_site = site;
}

public ProvisioningSitePipeBind(TeamNoGroupSiteCollection site)
{
_site = site;
}

public ProvisioningSitePipeBind(CommunicationSiteCollection site)
{
_site = site;
}

public SiteCollection Site => _site;

public SiteCollection GetSiteFromSequence(ProvisioningSequence sequence)
{
return sequence.SiteCollections.FirstOrDefault(s => s.Id == _site.Id);
}
}
}


17 changes: 17 additions & 0 deletions Commands/Model/PnPException.cs
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using System.Threading.Tasks;

namespace SharePointPnP.PowerShell.Commands.Model
{
public class PnPException
{
public string Message;
public string Stacktrace;
public int ScriptLineNumber;
public InvocationInfo InvocationInfo;
}
}
Expand Up @@ -795,6 +795,9 @@
<Width>36</Width>
<Alignment>left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Child Terms</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
Expand All @@ -805,6 +808,16 @@
<TableColumnItem>
<PropertyName>Id</PropertyName>
</TableColumnItem>
<TableColumnItem>
<ScriptBlock>
if($_.IsObjectPropertyInstantiated("Terms")){
$_.TermsCount
}
else{
"$($_.TermsCount) (Not loaded)"
}
</ScriptBlock>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
Expand Down Expand Up @@ -1270,5 +1283,51 @@
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>TaxonomySession</Name>
<ViewSelectedBy>
<TypeName>Microsoft.SharePoint.Client.Taxonomy.TaxonomySession</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>TermStores</Label>
<Alignment>left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>TermStores</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>PnPException</Name>
<ViewSelectedBy>
<TypeName>SharePointPnP.PowerShell.Commands.Model.PnPException</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<PropertyName>Message</PropertyName>
</ListItem>
<ListItem>
<PropertyName>Stacktrace</PropertyName>
</ListItem>
<ListItem>
<PropertyName>ScriptLineNumber</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
</ViewDefinitions>
</Configuration>
Expand Up @@ -795,6 +795,9 @@
<Width>36</Width>
<Alignment>left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Child Terms</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
Expand All @@ -805,6 +808,16 @@
<TableColumnItem>
<PropertyName>Id</PropertyName>
</TableColumnItem>
<TableColumnItem>
<ScriptBlock>
if($_.IsObjectPropertyInstantiated("Terms")){
$_.TermsCount
}
else{
"$($_.TermsCount) (Not loaded)"
}
</ScriptBlock>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
Expand Down Expand Up @@ -1270,5 +1283,51 @@
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>TaxonomySession</Name>
<ViewSelectedBy>
<TypeName>Microsoft.SharePoint.Client.Taxonomy.TaxonomySession</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>TermStores</Label>
<Alignment>left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>TermStores</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>PnPException</Name>
<ViewSelectedBy>
<TypeName>SharePointPnP.PowerShell.Commands.Model.PnPException</TypeName>
</ViewSelectedBy>
<ListControl>
<ListEntries>
<ListEntry>
<ListItems>
<ListItem>
<PropertyName>Message</PropertyName>
</ListItem>
<ListItem>
<PropertyName>Stacktrace</PropertyName>
</ListItem>
<ListItem>
<PropertyName>ScriptLineNumber</PropertyName>
</ListItem>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
</ViewDefinitions>
</Configuration>

0 comments on commit 7ed8ba9

Please sign in to comment.