pnp / PnP-PowerShell

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

[BUG] Get-PnPListItem throws a badly formatted error message for FolderServerRelativeUrl #2952

Open ERGeorgiev opened 3 years ago

ERGeorgiev commented 3 years ago

Reporting an Issue or Missing Feature

Reporting an issue.

Expected behavior

The code throws the following error: Get-PnPListItem : Server relative urls must start with SPWeb.ServerRelativeUrl

It seems like the error tries to interpolate a class variable, but fails to do so. Maybe because Write-Error doesn't allow for interpolation? Whatever the case, a better error message is needed as this isn't easy to decypher.

Actual behavior

The code throws the following error: Get-PnPListItem : Server relative urls must start with /sites/<subsite>/

Steps to reproduce behavior

When running Get-PnPListItem, set the FolderServerRelativeUrl parameter to a value that doesn't start with "/sites//".

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

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

3.25.2009.1

How did you install the PnP-PowerShell Cmdlets?