PnP-PowerShell icon indicating copy to clipboard operation
PnP-PowerShell copied to clipboard

Add-PnPDocumentSet Does not return a DocumentSetPipelineBind Item

Open crossan007 opened this issue 8 years ago • 6 comments

Reporting an Issue or Missing Feature

When creating various items using PnP, a PipelineBind object is often returned, which contains a reference to the newly created object (whether it be a GUID, or an ID, along with the parent container list / library). When creating a new Document Set, only a string of the newly created Document Set's location is returned.

The absence of a PipelineBind object makes it difficult to perform subsequent actions on the newly created Document Set (such as setting properties on the document set).

Expected behavior

The return of Add-PnPDocumentSet should return a PipelineBind object containing a pointer to the new Document Set

Actual behavior

A string is returned

Steps to reproduce behavior

Execute Add-PnPDocumentSet

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

  • [ ] PnP PowerShell for SharePoint 2013
  • [ ] PnP PowerShell for SharePoint 2016
  • [x] PnP PowerShell for SharePoint Online

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

2.21.17

How did you install the PnP-PowerShell Cmdlets?

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

crossan007 avatar Feb 08 '18 19:02 crossan007

I also ran into the same issue.

snjyrml avatar Feb 16 '18 17:02 snjyrml

What do you expect to be returned? PipeBindObjects are not objects that are supposed to be returned, they are only used internally for input parameters (their purpose is to allow people to use different types of values that point to a same object for a single parameter, e.g. strings and guids for an ID, or a contenttype object and contenttypeid for a content type).

Returning the actual DocumentSet object won't allow you to do much with, it has no properties as such other than a method which allows you to export is to a Stream.

erwinvanhunen avatar Feb 22 '18 13:02 erwinvanhunen

in the same vein, New-PnPList used to return the list object. Now I have to make an extra call with Get-PnPList

ghost avatar Feb 27 '18 21:02 ghost

@ricaea I checked the source code all the way back to august 2015, but New-PnPList never returned a list object.

erwinvanhunen avatar Feb 27 '18 21:02 erwinvanhunen

I would like that the Add-PnPDocumentSet returns the ID of the new created DocumentSet in stead of the string (url) to the documentset.

reinoutD avatar Oct 09 '18 09:10 reinoutD

I would like that the Add-PnPDocumentSet returns the ID of the new created DocumentSet in stead of the string (url) to the documentset.

Yess, that would be much helpful.

firozozman avatar Nov 11 '20 21:11 firozozman