I'd like to acquire the version history from a file of a trash can.

I'd like to acquire the version history from a file of a trash can. Is there a good way?

[premise]
version management of a document library.
There is a version history in an eliminated file.
I don't want to restore a file.

**[Code No.1]

//SPWeb.GetFile(strUrl)

$web = Get-SPWeb("http://server/siteurl/weburl")
$bin = $web.RecycleBin[0]

// $bin.DirName, $bin.LeafName

$file = $web.GetFile("libraryname/filename.xlsx")

// $file.Exists = false and $file.Versions.Count = 0
// A SPFile can't be acquired.


**[Code No.2]

//SPWeb.GetFile(uniqueId)

$web = Get-SPWeb("http://server/siteurl/weburl")
$bin = $web.RecycleBin[0]

// $bin.ID

$file = $web.GetFile($bin.ID)

// $file.Exists = false
// A SPFile can't be acquired.


Without restoring a file, can the version history be acquired?
How is it possible?

September 2nd, 2015 11:29pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics