株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

ファイルのメジャーバージョンをGetしてくるには一工夫が必要なんですね。

PS C:> $clientContext = Get-PnPContext
PS C:> $ListItem = Get-PnPFile -Url "/Shared Documents/Book.xlsx" -AsListItem
PS C:> $targetFile = $ListItem.File
PS C:> $clientContext.Load($targetFile)
PS C:> $clientContext.ExecuteQuery()
PS C:> Write-Host $targetFile.MajorVersion
3

参考
http://www.codesharepoint.com/powershell/get-major-version-of-file-in-sharepoint-using-powershell

これでいけると思ったけどできなかった。Get-Memberするとあるんだけど、、、

Get-PnPFile -Url "/Shared Documents/Book.xlsx" -AsListItem | Select-Object -Property Majorversion

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)