GeezerVison is showing github.com — Transition ActionPreference.Suspend enumeration value into a non-supported, reserved state, and remove restriction on using ActionPreference.Ignore in preference variables by KirkMunro · Pull Request #10317 · PowerShell/PowerShell
Conversation
PR Summary
As part of the cleanup of workflow code, this PR does the following:
- Treats
ActionPreference.Suspend enumeration value as not supported and reserved for future use.
- Update internal logic dependent on
ActionPreference.Suspend such that using that value results in appropriate error messages.
- Remove unused resource strings.
- Updated and added tests related to
ActionPreference.Suspend to ensure that it is generating the errors we expect when it is used.
- Remove unnecessary restriction around
ActionPreference.Ignore (see this discussion in issue 4348). This change is made as part of this PR because it is in the exact same body of code, and it makes sense to include it here.
PR Context
See issue #9570.
PR Checklist
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Make sure all
.h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
- This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.
- Breaking changes
- User-facing changes
- Testing - New and feature
- Tooling
- I have considered the user experience from a tooling perspective and don't believe tooling will be impacted.
- OR
- I have considered the user experience from a tooling perspective and enumerated concerns in the summary. This may include:
- Impact on PowerShell Editor Services which is used in the PowerShell extension for VSCode (which runs in a different PS Host).
- Impact on Completions (both in the console and in editors) - one of PowerShell's most powerful features.
- Impact on PSScriptAnalyzer (which provides linting & formatting in the editor extensions).
- Impact on EditorSyntax (which provides syntax highlighting with in VSCode, GitHub, and many other editors).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
iSazonov and mklement0 reacted with thumbs up emoji
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@PowerShell/powershell-committee the decision here is what to do about removing a workflow specific value from the existing public enum. One option is to mark it obsolete.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@PowerShell/powershell-committee reviewed this, we discussed removal, using [obsolete] attribute, and leaving as-is. We discussed the possibility of using this value in the future for job control if there is a way to suspend a PSJob. For that reason, we agreed to leave this enum value. We also recommend that we explicitly number enum values so in the future, if we do decide to remove a value and add another one, then existing code will break/behavior appropriately.
|
vexx32 and iSazonov reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
To address the committee review feedback, I just made the following changes:
- Put the enumerated value back.
- Updated internal logic to generate appropriate errors about using an enumerated value that is not supported and reserved for future use.
- Updated tests to ensure that it's behaving properly everywhere we need it to.
I'll also update the OP accordingly.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Note that regarding explicit numbering of the ActionPreference enumerated values, I have that handled in PR #8205.
Also, once either this PR or #8205 are merged in, I will update the other PR accordingly because there are some overlapping changes that I doubt will merge without manual intervention.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Kirk Munro (KirkMunro)
changed the title
Remove deprecated ActionPreference.Suspend enumeration value
Transition ActionPreference.Suspend enumeration value into a non-supported, reserved state.
Aug 22, 2019
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Just FYI in case it wasn't clear: I updated this PR once #8205 was merged into PowerShell, so this PR is one again ready for review/merge.
Two of the three Codacy issues are incorrect (looks like it needs to be updated for modern syntax), and the third one is related to a Pester test and will be ignored.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ghost
added
Waiting on Author
The PR was reviewed and requires changes or comments from the author before being accept
and removed
Waiting on Author
The PR was reviewed and requires changes or comments from the author before being accept
labels
Aug 29, 2019
|
FYI, I will not be making changes based on the Codacy review because one of the issues is a false positive, and the other two are incorrect. This PR is ready for review by other reviewers.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Kirk Munro (KirkMunro)
changed the title
Transition ActionPreference.Suspend enumeration value into a non-supported, reserved state.
Transition ActionPreference.Suspend enumeration value into a non-supported, reserved state, and remove restriction on using ActionPreference.Ignore in preference variables
Sep 6, 2019
|
🎉v7.0.0-preview.4 has been released which incorporates this pull request.:tada:
Handy links:
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Thatgfsj (Thatgfsj)
pushed a commit
to Thatgfsj-contribs/PowerShell
that referenced
this pull request
Aug 6, 2026
…orted, reserved state, and remove restriction on using ActionPreference.Ignore in preference variables (PowerShell#10317)
Reviewers
+2 more reviewers
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Labels
CL-CodeCleanup
Indicates that a PR should be marked as a Code Cleanup change in the Change Log
Committee-Reviewed
PS-Committee has reviewed this and made a decision
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|