0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SPOに格納されているファイルの旧バージョンをダウンロードするpowershell

Posted at
# SharePointサイトに接続
Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/yoursite" -Interactive

# 特定のファイルのバージョン履歴を取得
$fileUrl = "/sites/yoursite/Shared Documents/yourfile.xlsx"
$versions = Get-PnPFileVersion -Url $fileUrl

# 各バージョンをダウンロード
$downloadPath = "C:\Downloads\FileVersions\"
New-Item -ItemType Directory -Path $downloadPath -Force

foreach ($version in $versions) {
    $fileName = "yourfile_v$($version.VersionLabel).xlsx"
    Get-PnPFile -Url $fileUrl -AsFile -Path $downloadPath -Filename $fileName -Version $version.VersionLabel
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?