X Tutup
The Wayback Machine - https://web.archive.org/web/20251021015422/https://github.com/PowerShell/PowerShell/pull/17447
Skip to content

Conversation

PaulHigin
Copy link
Contributor

PR Summary

This PR adds a new -ConfigurationFile command line parameter to pwsh.exe, that takes a path to a .pssc configuration file.
This is an implementation of RFC.

PR Context

This new command line parameter will allow PowerShell interactive or server mode sessions to run in a session configured by the provided .pssc file.

PR Checklist

PaulHigin and others added 3 commits May 31, 2022 13:03
…meterParserStrings.resx

Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
…ngs.resx

Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
…Strings.resx

Co-authored-by: Dongbo Wang <dongbow@microsoft.com>
@PaulHigin PaulHigin added the Review - Committee The PR/Issue needs a review from the PowerShell Committee label May 31, 2022
@PaulHigin PaulHigin added Committee-Reviewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Jun 2, 2022
@PaulHigin
Copy link
Contributor Author

Committee decided an error should be thrown in Console.Start() API case, when there are conflicting session configuration directives.

@pull-request-quantifier-deprecated

This PR has 491 quantified lines of changes. In general, a change size of upto 200 lines is ideal for the best PR experience!


Quantification details

Label      : Extra Large
Size       : +390 -101
Percentile : 83.03%

Total files changed: 22

Change summary by file extension:
.cs : +310 -87
.resx : +27 -1
.ps1 : +17 -3
.psm1 : +36 -10

Change counts above are quantified counts, based on the PullRequestQuantifier customizations.

Why proper sizing of changes matters

Optimal pull request sizes drive a better predictable PR flow as they strike a
balance between between PR complexity and PR review overhead. PRs within the
optimal size (typical small, or medium sized PRs) mean:

  • Fast and predictable releases to production:
    • Optimal size changes are more likely to be reviewed faster with fewer
      iterations.
    • Similarity in low PR complexity drives similar review times.
  • Review quality is likely higher as complexity is lower:
    • Bugs are more likely to be detected.
    • Code inconsistencies are more likely to be detetcted.
  • Knowledge sharing is improved within the participants:
    • Small portions can be assimilated better.
  • Better engineering practices are exercised:
    • Solving big problems by dividing them in well contained, smaller problems.
    • Exercising separation of concerns within the code changes.

What can I do to optimize my changes

  • Use the PullRequestQuantifier to quantify your PR accurately
    • Create a context profile for your repo using the context generator
    • Exclude files that are not necessary to be reviewed or do not increase the review complexity. Example: Autogenerated code, docs, project IDE setting files, binaries, etc. Check out the Excluded section from your prquantifier.yaml context profile.
    • Understand your typical change complexity, drive towards the desired complexity by adjusting the label mapping in your prquantifier.yaml context profile.
    • Only use the labels that matter to you, see context specification to customize your prquantifier.yaml context profile.
  • Change your engineering behaviors
    • For PRs that fall outside of the desired spectrum, review the details and check if:
      • Your PR could be split in smaller, self-contained PRs instead
      • Your PR only solves one particular issue. (For example, don't refactor and code new features in the same PR).

How to interpret the change counts in git diff output

  • One line was added: +1 -0
  • One line was deleted: +0 -1
  • One line was modified: +1 -1 (git diff doesn't know about modified, it will
    interpret that line like one addition plus one deletion)
  • Change percentiles: Change characteristics (addition, deletion, modification)
    of this PR in relation to all other PRs within the repository.


Was this comment helpful? 👍  :ok_hand:  :thumbsdown: (Email)
Customize PullRequestQuantifier for this repository.

@daxian-dbw
Copy link
Member

The conflict check changes look good to me, but for the broken test, are you going to make further changes to enable it?

@PaulHigin
Copy link
Contributor Author

@daxian-dbw I was thinking of leaving the disabled (commented out) test as an FYI for future developers to understand why we can't do multiple command line parsing tests. We could add a whole new hosting SDK test, just for this error, so that it could run in a new process/session, but it doesn't seem worth while. I can remove the disabled test if you like.

Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

LGTM. I'm fine keeping the disabled test.

@daxian-dbw daxian-dbw merged commit a8d5585 into PowerShell:master Jun 6, 2022
@michaeltlombardi
Copy link
Contributor

@PaulHigin Could you file a docs-issue for this one? I see that the PR body's check list specifies docs are needed (and the functionality definitely needs documentation imo) but I don't see one filed.

I also noticed that there was an update to New-PSSessionConfigurationFile which seems to imply that this cmdlet will be available on Unix systems as well, going forward? I think that will also require a docs update, if so.

@daxian-dbw
Copy link
Member

@michaeltlombardi Thanks for catching this!

michaeltlombardi added a commit to michaeltlombardi/PowerShellDocs that referenced this pull request Jun 7, 2022
This change adds documentation for the new ConfigurationFile parameter
added to the pwsh executable in PowerShell/PowerShell#17447.

Resolves MicrosoftDocs#8907
michaeltlombardi added a commit to michaeltlombardi/PowerShellDocs that referenced this pull request Jun 8, 2022
This change adds documentation for the new ConfigurationFile parameter
added to the pwsh executable in PowerShell/PowerShell#17447.

Resolves MicrosoftDocs#8907
sdwheeler pushed a commit to MicrosoftDocs/PowerShell-Docs that referenced this pull request Jun 8, 2022
This change adds documentation for the new ConfigurationFile parameter
added to the pwsh executable in PowerShell/PowerShell#17447.

Resolves #8907
@adityapatwardhan adityapatwardhan added the CL-Engine Indicates that a PR should be marked as an engine change in the Change Log label Jun 20, 2022
@ghost
Copy link

ghost commented Jun 22, 2022

🎉v7.3.0-preview.5 has been released which incorporates this pull request.:tada:

Handy links:

@TravisEz13 TravisEz13 mentioned this pull request Sep 30, 2022
22 tasks
@PaulHigin PaulHigin deleted the local-configfile-switch branch January 3, 2023 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Engine Indicates that a PR should be marked as an engine change in the Change Log Committee-Reviewed PS-Committee has reviewed this and made a decision Extra Large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

X Tutup