Add-PnPFile with -Checkout -CheckInComment results in major version being created #2495
Closed
5 tasks
Labels
bug
Something isn't working
In a library with Major and Minor versions configured, when performing Add-PnPFile -Path -Folder -Checkout -CheckInComment "Testing", the file ends up being a .0 (i.e. published version) instead of an incremental version.
If you use -CheckInComment without the -Checkout option, a minor version is created, but the check in comment is ignored.
The -Publish option works as expected however. i.e. Add-PnPFile -Path -Folder -Publish -PublishComment "Testing"
Expected behavior
I would expect that if I use the -Checkout -CheckInComment scenario it should be creating a minor version. Documentation needs to be updated also to say that CheckInComment is ignored if you do not also use the -Checkout switch.
Actual behavior
Major version created.
Steps to reproduce behavior
Get-PnPFile -Url $item.FieldValues["FileRef"] -Path $MinorPath -FileName $item.FieldValues["FileLeafRef"] -AsFile -Force
then manipulate file
Add-PnPFile -Path $MinorFileName -Folder $TargetFolderPath -Checkout -CheckInComment $minorComment
What is the version of the Cmdlet module you are running?
1.11.0
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: