pnp / PnP-PowerShell

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

Get-PnPLabel verbose output instead of values #2678

Closed jpalo closed 4 years ago

jpalo commented 4 years ago

Reporting an Issue or Missing Feature

Get-PnPLabel returns verbose text instead of label name and properties, see actual behavior.

Expected behavior

Only return values, no extra text.

Actual behavior

WriteObject("The label '" + label.Value.TagName + "' is set to the specified list or library. ");
// There is no property yet that exposes if the SyncToItems is set or not.. :(
WriteObject("Block deletion: " + label.Value.BlockDelete.ToString());
WriteObject("Block editing: " + label.Value.BlockEdit.ToString());

image

Steps to reproduce behavior

Get-PnPLabel -List "some list title"

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

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

3.18.2002.0

How did you install the PnP-PowerShell Cmdlets?

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

KoenZomers commented 4 years ago

Definitely makes sense @jpalo. Working on a fix for it.

KoenZomers commented 4 years ago

Fixed. Will be released in the June 2020 release on next Tuesday June 9th, 2020. It will allow you to specify the -ValuesOnly flag to have it return way more verbose information and as normal properties instead of written text.

image

Closing this issue. If it doesn't work for you in the June 2020 release, feel free to reopen.

jpalo commented 4 years ago

Thank you for the flag.

I hope you depreciate the current verbose functionality in some future version, and remove the flag as this seems like a quick workaround that isn't a breaking change, but doesn't really fix the original cause.

KoenZomers commented 4 years ago

@jpalo We always need to keep backwards compatibility as there may be people out there that have written scripts to parse the human readable text into the actual values. Those scripts would break if we throw in changes like this. I agree that the initial implementation should never have been done in the way it has been done, but we're stuck with it now. Please use the -ValuesOnly option to get the desired result.