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

Adds support for -ErrorAction:Stop #2288

Merged
merged 4 commits into from
Aug 30, 2022
Merged

Conversation

KoenZomers
Copy link
Collaborator

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Requested through #2273

What is in this Pull Request ?

This PR adds support for using -ErrorAction:Stop in PnP PowerShell cmdlets. If something goes wrong, it will halt further script execution. Notice that if you were using this in combination with the specific try/catch [System.Management.Automation.PSInvalidOperationException], it will no longer catch the exception. It will throw an System.Management.Automation.ErrorRecord exception instead. Remove the -ErrorAction:Stop parameter from your cmdlet or catch this new exception type to avoid this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants