Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Fixes #2652

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions build/Build-Debug.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ if ($LocalPnPFramework) {
$pnpFrameworkAssembly = Join-Path $PSScriptRoot -ChildPath "..\..\pnpframework\src\lib\PnP.Framework\bin\Debug\netstandard2.0\PnP.Framework.dll"
$pnpFrameworkAssembly = [System.IO.Path]::GetFullPath($pnpFrameworkAssembly)
if (Test-Path $pnpFrameworkAssembly -PathType Leaf) {
$buildCmd += " -p:PnPFrameworkPath=`"..\..\..\pnpframework\src\lib\`""
$pnpFrameworkPath = $pnpFrameworkAssembly.Substring(0, $pnpFrameworkAssembly.IndexOf("PnP.Framework"))
Write-Host -Message "PnPFrameworkPath: $pnpFrameworkPath"
$buildCmd += " -p:PnPFrameworkPath=`"$pnpFrameworkPath`""
}
else {
$localFolder = Join-Path $PSScriptRoot -ChildPath "..\..\pnpframework"
Expand All @@ -66,7 +68,9 @@ if ($LocalPnPCore) {
$pnpCoreAssembly = Join-Path $PSScriptRoot -ChildPath "..\..\pnpcore\src\sdk\PnP.Core\bin\Debug\netstandard2.0\PnP.Core.dll"
$pnpCoreAssembly = [System.IO.Path]::GetFullPath($pnpCoreAssembly)
if (Test-Path $pnpCoreAssembly -PathType Leaf) {
$buildCmd += " -p:PnPCoreSdkPath=`"..\..\..\pnpcore\src\sdk\`""
$pnpCoreSdkPath = $pnpCoreAssembly.Substring(0, $pnpCoreAssembly.IndexOf("PnP.Core"))
Write-Host -Message "PnPCoreSdkPath: $pnpCoreSdkPath"
$buildCmd += " -p:PnPCoreSdkPath=`"$pnpCoreSdkPath`""
}
else {
$localFolder = Join-Path $PSScriptRoot -ChildPath "..\..\pnpcore"
Expand Down
11 changes: 10 additions & 1 deletion src/Commands/Base/SetTraceLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Diagnostics;
using System.Management.Automation;
using System.IO;

namespace PnP.PowerShell.Commands.Base
{
Expand Down Expand Up @@ -58,11 +59,19 @@ protected override void ProcessRecord()
{
LogFile = System.IO.Path.Combine(SessionState.Path.CurrentFileSystemLocation.Path, LogFile);
}
Console.WriteLine("LogFile path is : " + LogFile);
// Create DelimitedListTraceListener in case Delimiter parameter has been specified, if not create TextWritterTraceListener
#if !NETFRAMEWORK
var fileStreamOptions = new FileStreamOptions { Mode = FileMode.Append, BufferSize = AutoFlush ? 0 : 4096, Access = FileAccess.Write, Options = AutoFlush ? FileOptions.WriteThrough : FileOptions.None };
var fileStream = File.Open(LogFile, fileStreamOptions);
TraceListener listener = !string.IsNullOrEmpty(Delimiter) ?
new DelimitedListTraceListener(fileStream) { Delimiter = Delimiter, TraceOutputOptions = TraceOptions.DateTime } :
new TextWriterTraceListener(fileStream);
#else
TraceListener listener = !string.IsNullOrEmpty(Delimiter) ?
new DelimitedListTraceListener(LogFile) { Delimiter = Delimiter, TraceOutputOptions = TraceOptions.DateTime } :
new TextWriterTraceListener(LogFile);

#endif
listener.Name = FileListenername;
Trace.Listeners.Add(listener);
PnP.Framework.Diagnostics.Log.LogLevel = Level;
Expand Down
11 changes: 4 additions & 7 deletions src/Commands/PnP.PowerShell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,11 @@
<PackageReference Include="PnP.Core.Admin" Version="1.8.*-*" Condition="'$(IsRelease)' == '1'" />

<!-- currently for the following packages we only refer to the nightlies -->
<!-- <PackageReference Include="PnP.Core.Transformation" Version="1.6.*-*" Condition="'$(PnPCoreSdkPath)' == '' and '$(IsRelease)' != '1'" />
<PackageReference Include="PnP.Core.Transformation" Version="*" Condition="'$(IsRelease)' == '1'" /> -->
<PackageReference Include="PnP.Core.Transformation" Version="1.8.*-*" Condition="'$(PnPCoreSdkPath)' == '' and '$(IsRelease)' != '1'" />
<PackageReference Include="PnP.Core.Transformation" Version="1.8.*-*" Condition="'$(IsRelease)' == '1'" />

<PackageReference Include="PnP.Core.Transformation" Version="1.8.*-*" />

<!-- <PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.6.*-*" Condition="'$(PnPCoreSdkPath)' == '' and '$(IsRelease)' != '1'" />
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="*" Condition="'$(IsRelease)' == '1'" /> -->
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.8.*-*" />
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.8.*-*" Condition="'$(PnPCoreSdkPath)' == '' and '$(IsRelease)' != '1'" />
<PackageReference Include="PnP.Core.Transformation.SharePoint" Version="1.8.*-*" Condition="'$(IsRelease)' == '1'" />

<PackageReference Include="PowerShellStandard.Library" Version="5.1.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
Expand Down
8 changes: 7 additions & 1 deletion src/Commands/Provisioning/Site/GetSiteTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ public class GetSiteTemplate : PnPWebCmdlet
[Parameter(Mandatory = false)]
public ExtractConfigurationPipeBind Configuration;

[Parameter(Mandatory = false)]
public SwitchParameter UseFileStreams;

[Parameter(Mandatory = false, Position = 0)]
public string PnPTempFilesPath;

protected override void ExecuteCmdlet()
{
ExtractConfiguration extractConfiguration = null;
Expand Down Expand Up @@ -201,7 +207,7 @@ private void ExtractTemplate(XMLPnPSchemaVersion schema, string path, string pac
var fileSystemConnector = new FileSystemConnector(path, "");
if (extension == ".pnp")
{
creationInformation.FileConnector = new OpenXMLConnector(packageName, fileSystemConnector);
creationInformation.FileConnector = new OpenXMLConnector(packageName, fileSystemConnector, null, null, null, UseFileStreams, PnPTempFilesPath);
}
else if (extension == ".md")
{
Expand Down