Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Added the Folder parameter to Add-PnPDocumentSet #4029

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

danielcecil
Copy link
Contributor

Before creating a pull request, make sure that you have read the contribution file located at

https://github.com/pnp/powerShell/blob/dev/CONTRIBUTING.md

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes #4022

What is in this Pull Request ?

Adds a String -Folder parameter to the command, similar to Add-PnPListItem. Folder is created if needed.

Includes updated documentation too

Copy link
Collaborator

@gautamdsheth gautamdsheth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to use the implementation that we have in Add-PnPFolder for folder parameter

@@ -19,6 +19,9 @@ public class AddDocumentSet : PnPWebCmdlet
[ValidateNotNullOrEmpty]
public string Name;

[Parameter(Mandatory = false)]
public string Folder;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please modify this to use FolderPipeBind ? You can check & copy over the implementation that we have in Add-PnPFolder cmdlet, would make things easier and consistent for users

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gautamdsheth I can update this, however I used the logic in Add-PnPListItem which will create the folder if it doesn't exist. It also uses the relative path from the List.RootFolder e.g. "Folder A/Folder B" as in this command we are specifying the List already which makes sense rather than having to repeat the List name/path in the FolderPipeBand e.g. "Shared Documents/Folder A/Folder B"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielcecil - will merge it and make some changes later. The advantage of pipebind is that we can easily use it with Get-PnPFolder or related cmdlets. If you notice the code, it does create the folder if it doesn't exist in that cmdlet.

@gautamdsheth gautamdsheth merged commit 9c8866d into pnp:dev Aug 9, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add-PnpDocumentSet requires -Folder parameter
2 participants