1

I am trying to get the latest version's number

foreach($item in $listItems){
$fieldValues = @{
          "Title" = $item["Title"]
          "Created" = $item["Created"]
          "Modified" = $item["Author"]
  "Version"= $item.["_UIVersionString"] // internal name of version

      }

Here for all the pages i am getting the version number as 512

I also tried

$item.Versions.Count;

It is bringing total number of all the versions(including the minor versions) i.e if version number 50 has 8 minor versions (50.8) its counting that as seperate version as well

Is there any other way to get the number of the latest version for items?

2
_UIVersionString “1” = version “0.1”
_UIVersionString “2” = version “0.2”
_UIVersionString “3” = version “0.3”
_UIVersionString “512” = version “1.0”
_UIVersionString “1024” = version “2.0”
_UIVersionString “1025” = version “2.1”

Example : If page version is 5.4 Then it will show 2564

5 * 512 + 4 = 2564

We call this a "base-512" counting system in typical mathematics terms

0

I think $item["ows__UIVersionString"] should give you what you want.

0

I found the problem

when i was using "Version"= $item.["_UIVersionString"] i got base-512 versions as Vaibhav has pointed in his answer

But i am getting the correct version like 23.1 etc when i use "Version"= item["_UIVersionString"] (dot removed)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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