1

Is it possible to get when was the last WRITE time of a file in a document library by using Powershell?

$url = "http://myserver/sites/mysite/shared%20documents/myfile.xlsx"
$webclient = New-Object System.Net.WebClient
$lastWriteTimestamp = #...

1 Answer 1

1

Try following

$url = "http://myserver/sites/mysite/shared%20documents/myfile.xlsx"
$web = Get-SPWeb http://myserver/sites/mysite
$file = $web.GetFile($url)
$lastWriteTimestamp = $file.Item["Modified"]

OR

$lastWriteTimestamp =  $file.TimeLastModified

Find all properties of SPFile in MSDN

Your Answer

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

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