0

When using:

$web = get-spweb "http://myfarm/mysite/mysubsite"
$list = $web.Lists["My Library"]
$item = $list.Items.GetItemById(**123**)
$item.File.ReleaseLock($item.File.LockId)
$web.Dispose()

How do i find out Item Id? I assume it's not the documentId. Item path is Library/Folder/DocumentSet/document.xlsx

Ixinho
  • 63
  • 2
  • 9

1 Answers1

0

You can directly get a file using serverRelativeUrl in PowerShell.

$web = get-spweb "http://myfarm/mysite/mysubsite"
$file = $web.GetFile("FileUrl")
$file.ReleaseLock($file.LockId)
$web.Dispose()
Piyush
  • 215
  • 2
  • 10