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

Commit 5f4fdeb

Browse files
Merge pull request #3022 from pnp/dev
December 2020 Release
2 parents 7318423 + 99f8d0f commit 5f4fdeb

20 files changed

+127
-36
lines changed
512 Bytes
Binary file not shown.

Binaries/SharePointPnP.Modernization.Framework.xml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

Binaries/release/SharePointPnP.Modernization.Framework.xml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,23 @@ All notable changes to this project will be documented in this file.
55

66
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
77

8-
## [3.26.2010.0 - unreleased]
8+
## [3.28.2012.0]
9+
10+
### Added
11+
12+
### Changed
13+
- Small fixes to README.md
14+
- Fixed several issues with `Get-PnPSubwebs` and introduced optional parameter `-IncludeRootWeb` to include the rootweb in the results
15+
- Change in `Copy-PnPFile` which should resolve some issues you may run into when copying files [PR #2796](https://github.com/pnp/PnP-PowerShell/pull/2796)
16+
- Changed fallback scenario for 'Get-PnPFile' where downloading a file created by a user that no longer exists would try a different technique to download the file. This only worked on English environments though. With this fix, it should work for any language. [PR #2852](https://github.com/pnp/PnP-PowerShell/pull/2852)
17+
18+
### Contributors
19+
- David Blaszyk [acornsoft]
20+
- Koen Zomers [koenzomers]
21+
- Carlos Marins Jr [kadu-jr]
22+
- Heinrich Ulbricht [heinrich-ulbricht]
23+
24+
## [3.26.2010.0]
925

1026
### Added
1127
- Added `Set-PnPTenant -EnableAutoNewsDigest` option to disable the automatic news digest mails sent to end users [PR #2901](https://github.com/pnp/PnP-PowerShell/pull/2901)

Commands/Base/ConnectOnline.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,14 @@ protected void Connect()
656656
Url = Url.Substring(0, Url.Length - 1);
657657
}
658658

659+
#if !ONPREMISES
660+
if (!PnPConnectionHelper.LegacyMessageShown)
661+
{
662+
WriteUpdateMessage("\nYou are running the legacy version of PnP PowerShell.\nThis version will be archived soon which means that while staying available, no updates or fixes will be released.\nConsider installing the newer prereleased cross-platform version of PnP PowerShell:\n\nUninstall-Module -Name SharePointPnPPowerShellOnline -AllVersions -Force\nInstall-Module -Name PnP.PowerShell -AllowPrerelease\n\nRead more about the new cross-platform version of PnP PowerShell at\n\nhttps://pnp.github.io/powershell\n\nThe new version of PnP PowerShell will be released as 1.0 in January 2021.\n");
663+
PnPConnectionHelper.LegacyMessageShown = true;
664+
}
665+
#endif
666+
659667
PnPConnection connection = null;
660668

661669
var latestVersion = PnPConnectionHelper.GetLatestVersion();

Commands/Base/PnPConnectionHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ internal class PnPConnectionHelper
3636
private static readonly Uri VersionCheckUrl = new Uri("https://raw.githubusercontent.com/pnp/PnP-PowerShell/master/version.txt");
3737
#endif
3838
private static bool VersionChecked;
39+
internal static bool LegacyMessageShown;
3940

4041
#if !PNPPSCORE
4142
public static AuthenticationContext AuthContext { get; set; }

Commands/Base/RegisterPnPManagementShellAccess.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ public class RegisterPnPManagementShellAccess : PSCmdlet
2020
public AzureEnvironment AzureEnvironment = AzureEnvironment.Production;
2121

2222
[Parameter(Mandatory = true)]
23+
[Obsolete("This parameter will be ignored")]
2324
public string SiteUrl;
2425
protected override void ProcessRecord()
2526
{
2627
var endPoint = GenericToken.GetAzureADLoginEndPoint(AzureEnvironment);
27-
var uri = new Uri(SiteUrl);
28-
var scopes = new[] { $"{uri.Scheme}://{uri.Authority}//.default" };
29-
28+
3029
var application = PublicClientApplicationBuilder.Create(PnPConnection.PnPManagementShellClientId).WithAuthority($"{endPoint}/organizations/").WithRedirectUri("https://login.microsoftonline.com/common/oauth2/nativeclient").Build();
3130

32-
var result = application.AcquireTokenInteractive(scopes).ExecuteAsync().GetAwaiter().GetResult();
33-
result = application.AcquireTokenInteractive(new[] { "https://graph.microsoft.com/.default" }).ExecuteAsync().GetAwaiter().GetResult();
31+
application.AcquireTokenInteractive(new[] { "https://graph.microsoft.com/.default" }).ExecuteAsync().GetAwaiter().GetResult();
3432

3533
}
3634
}

Commands/Fields/AddField.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ public class AddField : PnPWebCmdlet, IDynamicParameters
7070
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ADDFIELDBYXMLTOLIST, HelpMessage = "The group name to where this field belongs to")]
7171
public string Group;
7272

73+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ADDFIELDTOLIST, HelpMessage = "Switch Parameter if this field must be added to all content types")]
74+
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ADDFIELDBYXMLTOLIST, HelpMessage = "Switch Parameter if this field must be added to all content types")]
75+
public SwitchParameter AddToAllContentTypes;
76+
7377
#if !ONPREMISES
7478
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ADDFIELDTOLIST, HelpMessage = "The Client Side Component Id to set to the field")]
7579
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ADDFIELDTOWEB, HelpMessage = "The Client Side Component Id to set to the field")]
@@ -122,6 +126,10 @@ protected override void ExecuteCmdlet()
122126
Group = Group,
123127
AddToDefaultView = AddToDefaultView
124128
};
129+
130+
if (AddToAllContentTypes)
131+
fieldCI.FieldOptions |= AddFieldOptions.AddToAllContentTypes;
132+
125133
#if !ONPREMISES
126134
if (ClientSideComponentId != null)
127135
{

Commands/Files/CopyFile.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ protected override void ExecuteCmdlet()
109109
TargetUrl = UrlUtility.Combine(webServerRelativeUrl, TargetUrl);
110110
}
111111

112+
string sourceFolder = SourceUrl.Substring(0, SourceUrl.LastIndexOf('/'));
112113
Uri currentContextUri = new Uri(ClientContext.Url);
113-
Uri sourceUri = new Uri(currentContextUri, SourceUrl);
114+
Uri sourceUri = new Uri(currentContextUri, sourceFolder);
114115
Uri sourceWebUri = Microsoft.SharePoint.Client.Web.WebUrlFromFolderUrlDirect(ClientContext, sourceUri);
115116
Uri targetUri = new Uri(currentContextUri, TargetUrl);
116117
Uri targetWebUri = Microsoft.SharePoint.Client.Web.WebUrlFromFolderUrlDirect(ClientContext, targetUri);

0 commit comments

Comments
 (0)