Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
5 tasks
acou1304 opened this issue Oct 26, 2022 · 0 comments · Fixed by #2806
Closed
5 tasks

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

acou1304 opened this issue Oct 26, 2022 · 0 comments · Fixed by #2806
Labels
bug Something isn't working

Comments

@acou1304
Copy link

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
@acou1304 acou1304 added the bug Something isn't working label Oct 26, 2022
gautamdsheth added a commit to gautamdsheth/powershell that referenced this issue Feb 12, 2023
@pnp pnp deleted a comment from github-actions bot Feb 15, 2023
KoenZomers added a commit that referenced this issue Feb 15, 2023
Fix #2495 - changed default checkin to minor version and added parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants