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

Commit f575c5b

Browse files
committed
Merge pull request #95 from OfficeDev/dev
October Release 2015 V2
2 parents 29cc2c2 + 05898de commit f575c5b

File tree

151 files changed

+400
-69471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+400
-69471
lines changed

Binaries/PnPPowerShellCommands15.msi

28 KB
Binary file not shown.

Binaries/PnPPowerShellCommands16.msi

28 KB
Binary file not shown.

Commands/Branding/GetProvisioningTemplate.cs

+18-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
namespace OfficeDevPnP.PowerShell.Commands.Branding
2222
{
2323
[Cmdlet(VerbsCommon.Get, "SPOProvisioningTemplate", SupportsShouldProcess = true)]
24-
[CmdletHelp("Generates a provisioning template from a web",
24+
[CmdletHelp("Generates a provisioning template from a web",
2525
Category = CmdletHelpCategory.Branding)]
2626
[CmdletExample(
2727
Code = @"
@@ -58,7 +58,7 @@ public class GetProvisioningTemplate : SPOWebCmdlet
5858
[Parameter(Mandatory = false, Position = 0, HelpMessage = "Filename to write to, optionally including full path")]
5959
public string Out;
6060

61-
[Parameter(Mandatory = false, Position = 0, HelpMessage = "The schema of the output to use, defaults to the latest schema")]
61+
[Parameter(Mandatory = false, Position = 1, HelpMessage = "The schema of the output to use, defaults to the latest schema")]
6262
public XMLPnPSchemaVersion Schema = XMLPnPSchemaVersion.LATEST;
6363

6464
[Parameter(Mandatory = false, HelpMessage = "If specified, all term groups will be included. Overrides IncludeSiteCollectionTermGroup.")]
@@ -71,14 +71,16 @@ public class GetProvisioningTemplate : SPOWebCmdlet
7171
public SwitchParameter IncludeSiteGroups;
7272

7373
[Parameter(Mandatory = false, HelpMessage = "If specified the files making up the composed look (background image, font file and color file) will be saved.")]
74-
public SwitchParameter PersistComposedLookFiles;
74+
public SwitchParameter PersistComposedLookFiles;
7575

7676
[Parameter(Mandatory = false, HelpMessage = "Overwrites the output file if it exists.")]
7777
public SwitchParameter Force;
7878

79+
[Parameter(Mandatory = false, DontShow = true, HelpMessage = "Exports the template without the use of a base template, causing all OOTB artifacts to be included. Using this switch is generally not required/recommended.")]
80+
public SwitchParameter NoBaseTemplate;
7981

8082
[Parameter(Mandatory = false)]
81-
public Encoding Encoding = System.Text.Encoding.Unicode;
83+
public System.Text.Encoding Encoding = System.Text.Encoding.Unicode;
8284

8385

8486
protected override void ExecuteCmdlet()
@@ -117,15 +119,25 @@ protected override void ExecuteCmdlet()
117119
private string GetProvisioningTemplateXML(XMLPnPSchemaVersion schema, string path)
118120
{
119121
SelectedWeb.EnsureProperty(w => w.Url);
120-
122+
121123
var creationInformation = new ProvisioningTemplateCreationInformation(SelectedWeb);
122124

125+
126+
123127
creationInformation.PersistComposedLookFiles = PersistComposedLookFiles;
124128
creationInformation.IncludeSiteGroups = IncludeSiteGroups;
125129

126130
creationInformation.FileConnector = new FileSystemConnector(path, "");
127131

128-
creationInformation.BaseTemplate = this.SelectedWeb.GetBaseTemplate();
132+
if (NoBaseTemplate)
133+
{
134+
creationInformation.BaseTemplate = null;
135+
}
136+
else
137+
{
138+
creationInformation.BaseTemplate = this.SelectedWeb.GetBaseTemplate();
139+
}
140+
129141
creationInformation.ProgressDelegate = (message, step, total) =>
130142
{
131143
WriteProgress(new ProgressRecord(0, string.Format("Extracting Template from {0}", SelectedWeb.Url), message) { PercentComplete = (100 / total) * step });

Commands/Enums/Encoding.cs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace OfficeDevPnP.PowerShell.Commands.Enums
8+
{
9+
public enum Encoding
10+
{
11+
Unicode = 0,
12+
ASCII = 1,
13+
BigEndianUnicode = 2,
14+
UTF32 = 3,
15+
UTF7 = 4,
16+
UTF8 = 5
17+
}
18+
}

Commands/OfficeDevPnP.PowerShell.Commands.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@
269269
<Compile Include="Enums\ConnectionType.cs" />
270270
<Compile Include="Enums\CredentialType.cs" />
271271
<Compile Include="Enums\DocumentSetFieldScope.cs" />
272+
<Compile Include="Enums\Encoding.cs" />
272273
<Compile Include="Enums\SearchConfigurationScope.cs" />
273274
<Compile Include="Enums\CustomActionScope.cs" />
274275
<Compile Include="Enums\FeatureScope.cs" />

Commands/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.7.1015.0")]
35-
[assembly: AssemblyFileVersion("1.7.1015.0")]
34+
[assembly: AssemblyVersion("1.7.1015.1")]
35+
[assembly: AssemblyFileVersion("1.7.1015.1")]

Commands/Taxonomy/ExportTaxonomy.cs

+46-5
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@
77
using OfficeDevPnP.PowerShell.Commands.Base.PipeBinds;
88
using File = System.IO.File;
99
using Resources = OfficeDevPnP.PowerShell.Commands.Properties.Resources;
10+
using OfficeDevPnP.PowerShell.Commands.Enums;
1011

1112
namespace OfficeDevPnP.PowerShell.Commands
1213
{
1314
[Cmdlet(VerbsData.Export, "SPOTaxonomy", SupportsShouldProcess = true)]
1415
[CmdletHelp("Exports a taxonomy to either the output or to a file.",
1516
Category = CmdletHelpCategory.Taxonomy)]
1617
[CmdletExample
17-
(Code = @"PS:> Export-SPOTaxonomy",
18+
(Code = @"PS:> Export-SPOTaxonomy",
1819
Remarks = "Exports the full taxonomy to the standard output",
1920
SortOrder = 1)]
2021
[CmdletExample(
21-
Code = @"PS:> Export-SPOTaxonomy -Path c:\output.txt",
22+
Code = @"PS:> Export-SPOTaxonomy -Path c:\output.txt",
2223
Remarks = "Exports the full taxonomy the file output.txt",
2324
SortOrder = 2)]
2425
[CmdletExample(
25-
Code = @"PS:> Export-SPOTaxonomy -Path c:\output.txt -TermSet f6f43025-7242-4f7a-b739-41fa32847254 ",
26+
Code = @"PS:> Export-SPOTaxonomy -Path c:\output.txt -TermSet f6f43025-7242-4f7a-b739-41fa32847254 ",
2627
Remarks = "Exports the term set with the specified id",
2728
SortOrder = 3)]
2829
public class ExportTaxonomy : SPOCmdlet
@@ -45,6 +46,9 @@ public class ExportTaxonomy : SPOCmdlet
4546
[Parameter(Mandatory = false)]
4647
public string Delimiter = "|";
4748

49+
[Parameter(Mandatory = false)]
50+
public Encoding Encoding = Encoding.Unicode;
51+
4852

4953
protected override void ExecuteCmdlet()
5054
{
@@ -82,16 +86,53 @@ protected override void ExecuteCmdlet()
8286
Path = System.IO.Path.Combine(SessionState.Path.CurrentFileSystemLocation.Path, Path);
8387
}
8488

89+
System.Text.Encoding textEncoding = System.Text.Encoding.Unicode;
90+
switch (Encoding)
91+
{
92+
case Encoding.ASCII:
93+
{
94+
textEncoding = System.Text.Encoding.ASCII;
95+
break;
96+
}
97+
98+
case Encoding.BigEndianUnicode:
99+
{
100+
textEncoding = System.Text.Encoding.BigEndianUnicode;
101+
break;
102+
}
103+
case Encoding.UTF32:
104+
{
105+
textEncoding = System.Text.Encoding.UTF32;
106+
break;
107+
}
108+
case Encoding.UTF7:
109+
{
110+
textEncoding = System.Text.Encoding.UTF7;
111+
break;
112+
}
113+
case Encoding.UTF8:
114+
{
115+
textEncoding = System.Text.Encoding.UTF8;
116+
break;
117+
}
118+
case Encoding.Unicode:
119+
{
120+
textEncoding = System.Text.Encoding.Unicode;
121+
break;
122+
}
123+
124+
}
125+
85126
if (File.Exists(Path))
86127
{
87128
if (Force || ShouldContinue(string.Format(Resources.File0ExistsOverwrite, Path), Resources.Confirm))
88129
{
89-
File.WriteAllLines(Path, exportedTerms);
130+
File.WriteAllLines(Path, exportedTerms, textEncoding);
90131
}
91132
}
92133
else
93134
{
94-
File.WriteAllLines(Path, exportedTerms);
135+
File.WriteAllLines(Path, exportedTerms, textEncoding);
95136
}
96137
}
97138
}

0 commit comments

Comments
 (0)