Skip to content

Add-PnPFile with -Checkout -CheckInComment results in major version being created #2495

@acou1304

Description

@acou1304

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?

  • [ X] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions