Skip to content

-Verbose should not override $ErrorActionPreference - #5113

Merged
Aditya Patwardhan (adityapatwardhan) merged 3 commits into
PowerShell:masterfrom
SteveL-MSFT:verbose-downgrade
Oct 26, 2017
Merged

Aditya Patwardhan (adityapatwardhan) merged 3 commits into
PowerShell:masterfrom
SteveL-MSFT:verbose-downgrade

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

Fix #2247

@anmenaga Andrew (anmenaga) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is only for Verbose;
however, original issue says that it was approved for both: Verbose and Debug : "Committee agrees that we should fix this so that -ErrorAction works correctly and not overridden by -Debug or -Verbose".
Should this change be done for Debug as well?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Andrew (@anmenaga) that's a fair point about -Debug. I'll update this.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Andrew (@anmenaga) can you review again?

Path = "$testdrive\test.txt";
Confirm = $false
}
New-Item @params

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> $null

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Aditya Patwardhan (@adityapatwardhan) can you review again?

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit b1af9ea into PowerShell:master Oct 26, 2017
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the verbose-downgrade branch October 26, 2017 22:35
@mintsoft

Copy link
Copy Markdown

Is this likely to make it into the final for Powershell 6?

@markekraus

Copy link
Copy Markdown
Contributor

Rob Emery (@mintsoft) This was merged to master so it will be in the release unless it needs to be reverted for some reason.

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
* -Verbose should not override $ErrorActionPreference

* apply same fix to -debug and added test case

* address Aditya's feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking-Change breaking change that may affect users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants