Skip to content

Commit

Permalink
Merge pull request #2510 from gautamdsheth/bugfix/2347
Browse files Browse the repository at this point in the history
Fix #2347 - issue with terminating error
  • Loading branch information
KoenZomers committed Oct 30, 2022
2 parents e0e3f2e + 418eb5e commit 09c32bc
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 @@ -92,6 +92,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Fixed issue with `Get-PnPRecycleBinItem` not working when there are large number of items in recycle bin.[#2472](https://github.com/pnp/powershell/pull/2472)
- Fixed Microsoft Graph based cmdlets not showing detailed error results when a call fails [#2490](https://github.com/pnp/powershell/pull/2490)
- Fixed `Restore-PnPRecycleBinItem` cmdlet not working with `-RowLimit` parameter. [#2499](https://github.com/pnp/powershell/pull/2499)
- Fixed cmdlets throwing error when `-ErrorAction SilentlyContinue` was specified. [#2510](https://github.com/pnp/powershell/pull/2510)

### Contributors

Expand Down
4 changes: 2 additions & 2 deletions src/Commands/Base/PnPConnectedCmdlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ protected override void ProcessRecord()
break;
}

// For backwards compatibility we will throw the exception as a PSInvalidOperationException if -ErrorAction:Stop has NOT been specified
if (!ParameterSpecified("ErrorAction") || MyInvocation.BoundParameters["ErrorAction"].ToString().ToLowerInvariant() != "stop")
// For backwards compatibility we will throw the exception as a PSInvalidOperationException if -ErrorAction:Stop has NOT been specified
if (!ParameterSpecified("ErrorAction") || (MyInvocation.BoundParameters["ErrorAction"].ToString().ToLowerInvariant() != "stop" && MyInvocation.BoundParameters["ErrorAction"].ToString().ToLowerInvariant() != "silentlycontinue"))
{
throw new PSInvalidOperationException(errorMessage);
}
Expand Down

0 comments on commit 09c32bc

Please sign in to comment.