Skip to content

New command: spo folder archive. Closes #7181#7239

Open
Saurabh7019 wants to merge 3 commits intopnp:mainfrom
Saurabh7019:issue-7181
Open

New command: spo folder archive. Closes #7181#7239
Saurabh7019 wants to merge 3 commits intopnp:mainfrom
Saurabh7019:issue-7181

Conversation

@Saurabh7019
Copy link
Copy Markdown
Contributor

Closes #7181

@Saurabh7019 Saurabh7019 marked this pull request as ready for review April 30, 2026 18:14
@milanholemans
Copy link
Copy Markdown
Contributor

Thanks! We'll try to review it ASAP.

@Adam-it Adam-it self-assigned this May 3, 2026
Copy link
Copy Markdown
Member

@Adam-it Adam-it left a comment

Choose a reason for hiding this comment

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

@Saurabh7019 solid work and I only noticed one thing to correct, but I have a few things we need to recheck before we proceed:

  1. If we execute this command on the library root level, we get a quite confusing error message, which does not help the user. If archiving on the root level of the document library is not possible, it would be best if we handle and catch this case and present a valuable error message to the user
Image
  1. I tested it locally, but I am not sure how to check if the folder is indeed archived 😁. I tried retrieving properties for that folder or any documents in that folder, and unfortunately non of them had any archived flag set. How did you test this command?

Comment thread src/m365/spo/commands/folder/folder-archive.ts Outdated
@Adam-it Adam-it marked this pull request as draft May 3, 2026 23:51
@Saurabh7019
Copy link
Copy Markdown
Contributor Author

  1. If we execute this command on the library root level, we get a quite confusing error message, which does not help the user. If archiving on the root level of the document library is not possible, it would be best if we handle and catch this case and present a valuable error message to the user

This is fixed.

  1. I tested it locally, but I am not sure how to check if the folder is indeed archived 😁. I tried retrieving properties for that folder or any documents in that folder, and unfortunately non of them had any archived flag set. How did you test this command?

You are right.. folder properties don't have an archival status. I tested it was by manually navigating to the folder in the UI and verifying that all files within the folder were archived. also, the archival can take some time to complete, so the status won't always be reflected immediately after the command runs. Let me know if you want me to include the below response for command execution,

{
  "IsArchive": true,
  "TotalFileCount": 1,
  "CreatedUtcDateTime": "2026-05-05T07:30:52.1673964Z",
  "LastStartedUtcDateTime": "0001-01-01T00:00:00",
  "FolderArchiveStatus": "Unknown",
  "ProcessedFileCount": 0,
  "SuccessCount": 0,
  "FailureCount": 0,
  "NotArchivableFileCount": 0,
  "ProgressPercentage": 0
}

I chose not include it to keep it aligned with file-archive command.

@Saurabh7019 Saurabh7019 marked this pull request as ready for review May 5, 2026 08:50
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.

New command: spo folder archive

3 participants