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

Commit 7ed8ba9

Browse files
Merge pull request #1728 from SharePoint/dev
October 2018 release
2 parents 25a8101 + c892448 commit 7ed8ba9

39 files changed

+1889
-169
lines changed

CHANGELOG.md

+18
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
77

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

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

1331
### Deprecated
1432

Commands/Admin/GetHubSite.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ namespace SharePointPnP.PowerShell.Commands.Admin
1313
[CmdletHelp(@"Retrieve all or a specific hubsite.",
1414
Category = CmdletHelpCategory.TenantAdmin,
1515
SupportedPlatform = CmdletSupportedPlatform.Online)]
16-
[CmdletExample(Code = @"PS:> Get-PnPStorageEntity", Remarks = "Returns all site storage entities/farm properties", SortOrder = 1)]
17-
[CmdletExample(Code = @"PS:> Get-PnPTenantSite -Key MyKey", Remarks = "Returns the storage entity/farm property with the given key.", SortOrder = 2)]
16+
[CmdletExample(Code = @"PS:> Get-PnPHubSite", Remarks = "Returns all hubsite properties", SortOrder = 1)]
17+
[CmdletExample(Code = @"PS:> Get-PnPHubSite -Identity https://contoso.sharepoint.com/sites/myhubsite", Remarks = "Returns the properties of the specified hubsite", SortOrder = 2)]
1818
public class GetHubSite : PnPAdminCmdlet
1919
{
2020
[Parameter(Position = 0, ValueFromPipeline = true)]

Commands/Base/GetException.cs

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using SharePointPnP.PowerShell.CmdletHelpAttributes;
2+
using SharePointPnP.PowerShell.Commands.Model;
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
using System.Management.Automation;
6+
7+
namespace SharePointPnP.PowerShell.Commands.Base
8+
{
9+
[Cmdlet(VerbsCommon.Get, "PnPException")]
10+
[CmdletHelp("Returns the last exception that occured",
11+
@"Returns the last exception which can be used while debugging PnP Cmdlets",
12+
Category = CmdletHelpCategory.Base)]
13+
[CmdletExample(
14+
Code = @"PS:> Get-PnPException",
15+
Remarks = "Returns the last exception",
16+
SortOrder = 1)]
17+
[CmdletExample(
18+
Code = @"PS:> Get-PnPException -All",
19+
Remarks = "Returns all exceptions that occurred",
20+
SortOrder = 2)]
21+
public class GetException : PSCmdlet
22+
{
23+
[Parameter(Mandatory = false, HelpMessage = "Show all exceptions")]
24+
public SwitchParameter All;
25+
26+
protected override void ProcessRecord()
27+
{
28+
var exceptions = (ArrayList)this.SessionState.PSVariable.Get("error").Value;
29+
if (exceptions.Count > 0)
30+
{
31+
var output = new List<PnPException>();
32+
if (All.IsPresent)
33+
{
34+
foreach (ErrorRecord exception in exceptions)
35+
{
36+
output.Add(new PnPException() { Message = exception.Exception.Message, Stacktrace = exception.Exception.StackTrace, ScriptLineNumber = exception.InvocationInfo.ScriptLineNumber, InvocationInfo = exception.InvocationInfo });
37+
}
38+
}
39+
else
40+
{
41+
var exception = (ErrorRecord)exceptions[0];
42+
output.Add(new PnPException() { Message = exception.Exception.Message, Stacktrace = exception.Exception.StackTrace, ScriptLineNumber = exception.InvocationInfo.ScriptLineNumber, InvocationInfo = exception.InvocationInfo });
43+
}
44+
WriteObject(output, true);
45+
}
46+
}
47+
}
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using OfficeDevPnP.Core.Framework.Provisioning.Model;
2+
using System;
3+
using System.Linq;
4+
5+
namespace SharePointPnP.PowerShell.Commands.Base.PipeBinds
6+
{
7+
public sealed class ProvisioningSequencePipeBind
8+
{
9+
private readonly ProvisioningSequence _sequence;
10+
private readonly string _identity;
11+
12+
public ProvisioningSequencePipeBind(ProvisioningSequence sequence)
13+
{
14+
_sequence = sequence;
15+
}
16+
17+
public ProvisioningSequencePipeBind(string identity)
18+
{
19+
_identity = identity;
20+
}
21+
22+
public ProvisioningSequence GetSequenceFromHierarchy(ProvisioningHierarchy hierarchy)
23+
{
24+
var id = string.Empty;
25+
if(_sequence == null)
26+
{
27+
id = _identity;
28+
} else
29+
{
30+
id = _sequence.ID;
31+
}
32+
return hierarchy.Sequences.FirstOrDefault(s => s.ID == id);
33+
}
34+
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using OfficeDevPnP.Core.Framework.Provisioning.Model;
2+
using System;
3+
using System.Linq;
4+
5+
namespace SharePointPnP.PowerShell.Commands.Base.PipeBinds
6+
{
7+
public sealed class ProvisioningSitePipeBind
8+
{
9+
private readonly SiteCollection _site;
10+
11+
public ProvisioningSitePipeBind(TeamSiteCollection site)
12+
{
13+
_site = site;
14+
}
15+
16+
public ProvisioningSitePipeBind(TeamNoGroupSiteCollection site)
17+
{
18+
_site = site;
19+
}
20+
21+
public ProvisioningSitePipeBind(CommunicationSiteCollection site)
22+
{
23+
_site = site;
24+
}
25+
26+
public SiteCollection Site => _site;
27+
28+
public SiteCollection GetSiteFromSequence(ProvisioningSequence sequence)
29+
{
30+
return sequence.SiteCollections.FirstOrDefault(s => s.Id == _site.Id);
31+
}
32+
}
33+
}
34+
35+

Commands/Model/PnPException.cs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Management.Automation;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace SharePointPnP.PowerShell.Commands.Model
9+
{
10+
public class PnPException
11+
{
12+
public string Message;
13+
public string Stacktrace;
14+
public int ScriptLineNumber;
15+
public InvocationInfo InvocationInfo;
16+
}
17+
}

Commands/ModuleFiles/SharePointPnP.PowerShell.2013.Commands.Format.ps1xml

+59
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,9 @@
795795
<Width>36</Width>
796796
<Alignment>left</Alignment>
797797
</TableColumnHeader>
798+
<TableColumnHeader>
799+
<Label>Child Terms</Label>
800+
</TableColumnHeader>
798801
</TableHeaders>
799802
<TableRowEntries>
800803
<TableRowEntry>
@@ -805,6 +808,16 @@
805808
<TableColumnItem>
806809
<PropertyName>Id</PropertyName>
807810
</TableColumnItem>
811+
<TableColumnItem>
812+
<ScriptBlock>
813+
if($_.IsObjectPropertyInstantiated("Terms")){
814+
$_.TermsCount
815+
}
816+
else{
817+
"$($_.TermsCount) (Not loaded)"
818+
}
819+
</ScriptBlock>
820+
</TableColumnItem>
808821
</TableColumnItems>
809822
</TableRowEntry>
810823
</TableRowEntries>
@@ -1270,5 +1283,51 @@
12701283
</TableRowEntries>
12711284
</TableControl>
12721285
</View>
1286+
<View>
1287+
<Name>TaxonomySession</Name>
1288+
<ViewSelectedBy>
1289+
<TypeName>Microsoft.SharePoint.Client.Taxonomy.TaxonomySession</TypeName>
1290+
</ViewSelectedBy>
1291+
<TableControl>
1292+
<TableHeaders>
1293+
<TableColumnHeader>
1294+
<Label>TermStores</Label>
1295+
<Alignment>left</Alignment>
1296+
</TableColumnHeader>
1297+
</TableHeaders>
1298+
<TableRowEntries>
1299+
<TableRowEntry>
1300+
<TableColumnItems>
1301+
<TableColumnItem>
1302+
<PropertyName>TermStores</PropertyName>
1303+
</TableColumnItem>
1304+
</TableColumnItems>
1305+
</TableRowEntry>
1306+
</TableRowEntries>
1307+
</TableControl>
1308+
</View>
1309+
<View>
1310+
<Name>PnPException</Name>
1311+
<ViewSelectedBy>
1312+
<TypeName>SharePointPnP.PowerShell.Commands.Model.PnPException</TypeName>
1313+
</ViewSelectedBy>
1314+
<ListControl>
1315+
<ListEntries>
1316+
<ListEntry>
1317+
<ListItems>
1318+
<ListItem>
1319+
<PropertyName>Message</PropertyName>
1320+
</ListItem>
1321+
<ListItem>
1322+
<PropertyName>Stacktrace</PropertyName>
1323+
</ListItem>
1324+
<ListItem>
1325+
<PropertyName>ScriptLineNumber</PropertyName>
1326+
</ListItem>
1327+
</ListItems>
1328+
</ListEntry>
1329+
</ListEntries>
1330+
</ListControl>
1331+
</View>
12731332
</ViewDefinitions>
12741333
</Configuration>

Commands/ModuleFiles/SharePointPnP.PowerShell.2016.Commands.Format.ps1xml

+59
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,9 @@
795795
<Width>36</Width>
796796
<Alignment>left</Alignment>
797797
</TableColumnHeader>
798+
<TableColumnHeader>
799+
<Label>Child Terms</Label>
800+
</TableColumnHeader>
798801
</TableHeaders>
799802
<TableRowEntries>
800803
<TableRowEntry>
@@ -805,6 +808,16 @@
805808
<TableColumnItem>
806809
<PropertyName>Id</PropertyName>
807810
</TableColumnItem>
811+
<TableColumnItem>
812+
<ScriptBlock>
813+
if($_.IsObjectPropertyInstantiated("Terms")){
814+
$_.TermsCount
815+
}
816+
else{
817+
"$($_.TermsCount) (Not loaded)"
818+
}
819+
</ScriptBlock>
820+
</TableColumnItem>
808821
</TableColumnItems>
809822
</TableRowEntry>
810823
</TableRowEntries>
@@ -1270,5 +1283,51 @@
12701283
</TableRowEntries>
12711284
</TableControl>
12721285
</View>
1286+
<View>
1287+
<Name>TaxonomySession</Name>
1288+
<ViewSelectedBy>
1289+
<TypeName>Microsoft.SharePoint.Client.Taxonomy.TaxonomySession</TypeName>
1290+
</ViewSelectedBy>
1291+
<TableControl>
1292+
<TableHeaders>
1293+
<TableColumnHeader>
1294+
<Label>TermStores</Label>
1295+
<Alignment>left</Alignment>
1296+
</TableColumnHeader>
1297+
</TableHeaders>
1298+
<TableRowEntries>
1299+
<TableRowEntry>
1300+
<TableColumnItems>
1301+
<TableColumnItem>
1302+
<PropertyName>TermStores</PropertyName>
1303+
</TableColumnItem>
1304+
</TableColumnItems>
1305+
</TableRowEntry>
1306+
</TableRowEntries>
1307+
</TableControl>
1308+
</View>
1309+
<View>
1310+
<Name>PnPException</Name>
1311+
<ViewSelectedBy>
1312+
<TypeName>SharePointPnP.PowerShell.Commands.Model.PnPException</TypeName>
1313+
</ViewSelectedBy>
1314+
<ListControl>
1315+
<ListEntries>
1316+
<ListEntry>
1317+
<ListItems>
1318+
<ListItem>
1319+
<PropertyName>Message</PropertyName>
1320+
</ListItem>
1321+
<ListItem>
1322+
<PropertyName>Stacktrace</PropertyName>
1323+
</ListItem>
1324+
<ListItem>
1325+
<PropertyName>ScriptLineNumber</PropertyName>
1326+
</ListItem>
1327+
</ListItems>
1328+
</ListEntry>
1329+
</ListEntries>
1330+
</ListControl>
1331+
</View>
12731332
</ViewDefinitions>
12741333
</Configuration>

0 commit comments

Comments
 (0)