I want to fetch latest or current version of an item in a document library.
How can I achieve this using PowerShell Scripting?
Is $version.VersionLabel
value of version number?
But I don't want to loop through $item.Versions
, I just want the current or latest version of an item.
Thanks in advance.`
foreach($item in $ItemCollection)
{
foreach($version in $item.Versions)
{
Write-Host "Documen Library:" $list.Title "-" "Document:" $item.Title $version.VersionLabel
}
}