Skip to content

Commit

Permalink
Merge pull request #3403 from gautamdsheth/bugfix/3112
Browse files Browse the repository at this point in the history
Fix #3112 - issue with file checkout and checkin
  • Loading branch information
KoenZomers authored Sep 18, 2023
2 parents 168a9c3 + 7a8da90 commit 2ab0b0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Improved `Set-PnPListItem` cmdlet handling of Purview labels. [#3340](https://github.com/pnp/powershell/pull/3340)
- The `Publish-PnPCompanyApp` cmdlet is now obsolete. It will be removed in the next version. [#3349](https://github.com/pnp/powershell/pull/3349)
- Verbose output will no longer show the access token [#3352](https://github.com/pnp/powershell/pull/3352)
- Improved `Add-PnPFile` cmdlet. It will now automatically checkout the file if `-CheckinType` parameter is specified. [#3403](https://github.com/pnp/powershell/pull/3403)

### Removed

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/Files/AddFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected override void ExecuteCmdlet()
}

// Check if the file exists
if (Checkout)
if (Checkout || ParameterSpecified(nameof(CheckinType)))
{
try
{
Expand Down Expand Up @@ -165,7 +165,7 @@ protected override void ExecuteCmdlet()
item.UpdateOverwriteVersion();
}

if (Checkout)
if (Checkout || ParameterSpecified(nameof(CheckinType)))
{
CurrentWeb.CheckInFile(fileUrl, CheckinType, CheckInComment);
}
Expand Down

0 comments on commit 2ab0b0f

Please sign in to comment.