pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

[BUG] #2920

Open ToddKlindt opened 4 years ago

ToddKlindt commented 4 years ago

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?

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?

jackpoz commented 4 years ago

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 😄 )

ToddKlindt commented 4 years ago

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.