pnp / pnp/powershell

Copy-PnpFile -SkipSourceFolderName Return

Open
#1,946 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
904
Forks
407
Avg merge
9h 16m
Merged PRs (30d)
10

Description

Is your feature request related to a problem? Please describe.
The problem is that Copy-PnpFile no longer has the functionality to copy a folder's contents into the root of another location (whether document library, subfolder, and regardless of whether its in the same site collection or not).

Describe the solution you'd like
We'd like to see the parameter -SkipSourceFolderName return. We don't know why it was removed, but this module indicates "WARNING: Parameter 'SkipSourceFolderName' is obsolete. This parameter is obsolete and has no effect currently."

Describe alternatives you've considered
We are struggling to find a solution. One alternative would involve manually writing code to get all files and folders in a given subfolder, run Copy-PnpFile on each file and then repeat for each subfolder with its contents. It's possibly doable with the current cmdlet, but less effective.

Additional context
We need to migrate the entire contents of a subfolder of a single document library to a new site collection created based on a template site, and also grant permissions to this newly created site collection. The document migration is a part of that overall algorithm.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Copy-PnpFile cmdlet entry point and trace how the obsolete SkipSourceFolderName parameter is handled. Compare the current copy behavior for folders and destinations across site collections. Done means the parameter again copies a folder's contents into the destination root, with behavior covering the document-library and subfolder cases described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.