0

I'm trying to use Move-PnPFolder to move a Document Set from one library to another library on the same site.

Code:

Move-PnPFolder -Folder $sourcePath -TargetFolder $destPath -Connection $devDestCon

Error:

Move-PnPFolder : This operation is not supported.

If this command is not available on Document Sets, what command should be used?

The source and destination libraries are identical.
List validations have been removed.
My test Document Set is empty / contains no files. Classic Document Set experience*

SharePoint version: SharePoint Online

1
  • Can you provide an example of your command? I have just tested it and I had no issues moving document sets with the Move-PnPFilder commandlet. Apr 7, 2021 at 1:47

2 Answers 2

0

Move a folder to another location in the current web. If you want to move a folder to a different site collection, use the Move-PnPFile cmdlet instead, which also supports moving folders and also across site collections.

Here is a successful within the same site collection. Document sets A and B were moved from one library to another:

Connect-PnPOnline -UseWebLogin -Url https://tenant.Sharepoint.com/sites/Sandbox
Move-PnPFolder -Folder DocumentSetA/A -TargetFolder DocumentSetB
Move-PnPFolder -Folder DocumentSetA/B -TargetFolder DocumentSetB

enter image description here

If you are moving document sets across different subsites or site collections, then you should use the Move-PnPFile commandlet:

Move-PnPFile -SourceUrl "/sites/project/Shared Documents/Archive" -TargetUrl "/sites/archive/Project" -AllowSchemaMismatch -AllowSmallerVersionLimitOnDestination
0

In my test, using the Move-PnPFolder command can successfully move the Document Set to another Document library in the same site.

Here is the PnP PowerShell command:

$SiteURL= "https://tenant.sharepoint.com/sites/sitename"
$username = "[email protected]"
$credential = Get-Credential -UserName $username -Message "Type the password:"
Connect-PnPOnline -Url $SiteUrl -Credentials $credential
Move-PnPFolder -Folder 'Shared Documents/Set1' -TargetFolder 'Documents_B'

enter image description here

enter image description here

More information, please refer to this article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.