Pnp-powershell: Add-PnPDocumentSet Does not return a DocumentSetPipelineBind Item

Created on 8 Feb 2018  路  6Comments  路  Source: pnp/PnP-PowerShell

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

Most helpful comment

I also ran into the same issue.

All 6 comments

I also ran into the same issue.

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.

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

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

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robbert-vanandel picture robbert-vanandel  路  29Comments

Forket picture Forket  路  39Comments

janegilring picture janegilring  路  23Comments

DanielSanIT picture DanielSanIT  路  59Comments

heinrich-ulbricht picture heinrich-ulbricht  路  14Comments