Skip to content

Commit

Permalink
Excluded the plus sign from getting decoded in Get-PnPFile (#1990)
Browse files Browse the repository at this point in the history
* Excluded the plus sign from getting decoded

* Added PR reference

Co-authored-by: = <=>
  • Loading branch information
KoenZomers authored Jun 16, 2022
1 parent c88f604 commit 6bbc6b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed `Add-PnPTeamsUser`, the parameter `-Channel` is now not required. [#1953](https://github.com/pnp/powershell/pull/1953)
- Fixed `Get-PnPPlannerTask` throwing an object reference exception for completed tasks [#1956](https://github.com/pnp/powershell/issues/1956)
- Fixed `Get-PnPUserOneDriveQuota` returning the maximum possible quota instead of the actual configured quota on a OneDrive for Business site [#1902](https://github.com/pnp/powershell/pull/1902)
- Fixed `Get-PnPFile` throwing an exception when trying to download a file containing the plus character [#1990](https://github.com/pnp/powershell/pull/1990)
- Fixed `Get-PnPTeamsChannel` not working correctly with PowerShell select. [#1988](https://github.com/pnp/powershell/pull/1988)
- Fixed `Update-PnPSiteClassification`, it was ignoring the `Settings` parameter. It will now be processed. [#1989](https://github.com/pnp/powershell/pull/1989)

Expand Down
5 changes: 2 additions & 3 deletions src/Commands/Files/GetFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using PnP.Core.Model.SharePoint;
using PnP.Core.Services;
using PnP.Framework.Utilities;
using System;
using System.IO;
using System.Management.Automation;
using System.Threading.Tasks;
Expand Down Expand Up @@ -68,8 +67,8 @@ protected override void ExecuteCmdlet()
}
}

// Remove URL decoding from the Url as that will not work
Url = Utilities.UrlUtilities.UrlDecode(Url);
// Remove URL decoding from the Url as that will not work. We will encode the + character specifically, because if that is part of the filename, it needs to stay and not be decoded.
Url = Utilities.UrlUtilities.UrlDecode(Url.Replace("+", "%2B"));

var webUrl = CurrentWeb.EnsureProperty(w => w.ServerRelativeUrl);

Expand Down

0 comments on commit 6bbc6b7

Please sign in to comment.