Pnp-powershell: [BUG]

Created on 16 Sep 2020  路  2Comments  路  Source: pnp/PnP-PowerShell

Reporting an Issue or Missing Feature

When using Connect-PnPOnline with a credential being passed, it does not match a stored credential if the stored credential has a trailing slash and the URL passed to -Url does not.

Expected behavior

The stored credential would be used whether it was created with a trailing slash or not.

Actual behavior

The stored credential is not used.

Steps to reproduce behavior

Create a stored credential where the -Name has a trailing slash, like https://M365x541279.sharepoint.com/. It does not get used when connecting to that same URL without the trailing slash, like https://M365x541279.sharepoint.com.

image

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint 2013
  • [ ] PnP PowerShell for SharePoint 2016
  • [ ] PnP PowerShell for SharePoint 2019
  • [X] PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name sharepointpnppowershell* -ListAvailable)
3.25.2009.1

How did you install the PnP-PowerShell Cmdlets?

  • [ ] MSI Installed downloaded from GitHub
  • [X] Installed through the PowerShell Gallery with Install-Module
  • [ ] Other means
bug

All 2 comments

I created a Pull Request at https://github.com/pnp/PnP-PowerShell/pull/2925 that just removes the '/' at the end when storing the url in credentials manager (by the way it's one of the best commands ever 馃槃 )

I created a Pull Request at #2925 that just removes the '/' at the end when storing the url in credentials manager (by the way it's one of the best commands ever 馃槃 )

We should still fix Connect-PnPonline, in case the credential was created with something else.

Was this page helpful?
0 / 5 - 0 ratings