[BUG] Set-PnPListItem updating version to now for a major version when I pass value #4533
              
                Unanswered
              
          
                  
                    
                      robinpemberton
                    
                  
                
                  asked this question in
                General
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I am using the command
Set-PnPListItem -List "Documents" -Identity $listItem -Values @{Modified = $dateModified} -UpdateType UpdateOverwriteVersion
to set the modified value for a major version file
code as:
if ($isMinor) {
# Check in as minor version
$SPFile = Add-PnPFile -Path $filePath -NewFileName $LatestFilename -Folder "Shared Documents" -CheckInComment "Version name: $original_filename; Version:$version; Comment: $comment" -CheckInType MinorCheckIn
$listItem = Get-PnPFile -Url "/sites/CFRS/Shared%20Documents/$LatestFilename" -AsListItem
Set-PnPListItem -List "Documents" -Identity $listItem -Values @{Modified = $dateModified} -UpdateType UpdateOverwriteVersion
} else {
Minor check sets modified fine however major is now.
PowerShell version running in PowerShell version 7
Manifest 2.12.0 PnP.PowerShell
On Windows.
Thanks,
R
Beta Was this translation helpful? Give feedback.
All reactions