Skip to content

Enable loading of Feedback providers via config #25115

Closed

Description

@SteveL-MSFT

Summary of the new feature / enhancement

Some native commands may want to participate by providing a Feedback provider, but not want to craft a whole module just for it. Tools today modify the user's $profile during app install and can be tricky to remove correctly during uninstall.

Proposed technical implementation details (optional)

Extend powershell.config.json to have a section for Feedback providers. Essentially containing this section:

(actual implementation will be in JSON, using YAML for readability)

FeedbackProviders:
  - Name: WinGet CommandNotFound
     Path: $env:programfiles\foo\bar.dll
     Enabled: true

The system config.json would be the default and users can override with their own config.json (setting Enabled: false).

Feedback providers loaded on startup via this method would need to have some message shown to inform the user.

One problem is that new installs of PS7 have a default system config.json which would clobber the old one. Perhaps instead we should have the system one under ProgramData (on Windows) which would be the one apps can modify for install/uninstall.

Activity

  1. added
    Issue-Enhancement
    Needs-Triage
    on Mar 2, 2025
  2. SteveL-MSFT commented on Mar 2, 2025

    @SteveL-MSFT
    MemberAuthor
  3. daxian-dbw commented on Mar 3, 2025

    @daxian-dbw
    Member

    Asking each tool to update a config.json file -- would that be the same as asking tools to update the profile? All tools still need to change a file to add/remove a section, and they will need to get permission from user first before doing it because no one wants the PowerShell startup suddenly slows down without knowing why (I installed miniconda on my personal computer recently which adds a allUsers profile that slows down PowerShell startup. It took me sometime to figure out why PS suddenly slows down).

    Ideally, the loading of a feedback provider should be lazy, which only happens when the native command run fails. I like the directory mechanism used on Linux better but need to think about how to use that for feedback provider loading.

  4. iSazonov commented on Mar 3, 2025

    @iSazonov
    Collaborator

    Why really invent something if there is already a module mechanism? All you need is a contract on how to find them (by specific name format or a flag in manifest) and download them automatically at the right time.

  5. SteveL-MSFT commented on Mar 3, 2025

    @SteveL-MSFT
    MemberAuthor

    Updating a json file (which is structured) isn't the same as adding/removing lines from $profile which is a script.

    Ilya (@iSazonov) , rhubarb-geek-nz the intent is to enable apps/tools that DON'T have a PowerShell module, they are native commands that want PowerShell integration. We have some partners asking for this, so this isn't a hypothetical situation.

    The directory mechanism means you would still need some config for the user to indicate they DON'T want auto-loading of some extensions.

  6. added
    WG-Interactive-Console
    WG-NeedsReview
    on Mar 3, 2025
  7. iSazonov commented on Mar 4, 2025

    @iSazonov
    Collaborator

    @iSazonov , @rhubarb-geek-nz the intent is to enable apps/tools that DON'T have a PowerShell module, they are native commands that want PowerShell integration. We have some partners asking for this, so this isn't a hypothetical situation.

    Thanks for clarify! Although there is still little information to understand their request. When I think of a native app, I imagine that it uses the SDK. Then why bother with the config at all - rather, you need a public API to discover and manage the providers. In this case, if the config is needed, then the application itself, but not for pwsh.

  8. daxian-dbw commented on Mar 6, 2025

    @daxian-dbw
    Member

    the intent is to enable apps/tools that DON'T have a PowerShell module, they are native commands that want PowerShell integration. We have some partners asking for this, so this isn't a hypothetical situation.

    The directory mechanism doesn't necessarily require a module to be present. The configuration in the directory of a specific tool just need to indicate where to find the provider -- it could be from a module, or from an assembly (which may just be deployed in that directory).

    The directory mechanism means you would still need some config for the user to indicate they DON'T want auto-loading of some extensions.

    No matter it's the PowerShell config file or the directory mechanism, the installation always needs to get permission from user before making the change. For the directory approach, we can define a key in the configuration of each directory to control whether it's disabled. The benefits of the directory mechanism are:

    1. Lazy loading
    2. Take effect right after the installation of the tool thanks to the lazy loading.
    3. Safer update and cleanup -- different tools operating on different directories/files.
  9. daxian-dbw commented on Mar 19, 2025

    @daxian-dbw
    Member

    Steve Lee (@SteveL-MSFT) I submitted a draft spec for auto-discovering feedback providers and tab-completers: PowerShell/PowerShell-RFC#386

  10. added
    Resolution-Declined
    WG-Reviewed
    and removed
    Needs-Triage
    WG-NeedsReview
    on May 14, 2025
  11. theJasonHelmick commented on May 14, 2025

    @theJasonHelmick
    Collaborator

    Thank you Steve Lee (@SteveL-MSFT) for this issue. The WG interactive has reviewed this and prefers the alternative mini-spec from Dongbo Wang (@daxian-dbw) and would like to see that move forward. spec: PowerShell/PowerShell-RFC#386

  12. microsoft-github-policy-service commented on May 16, 2025

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as declined and has not had any activity for 1 day. It has been closed for housekeeping purposes.

  13. microsoft-github-policy-service commented on May 16, 2025

    @microsoft-github-policy-service
    Contributor

    📣 Hey @Steve Lee (@SteveL-MSFT), how did we do? We would love to hear your feedback with the link below! 🗣️

    🔗 https://aka.ms/PSRepoFeedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-EnhancementResolution-DeclinedWG-Interactive-ConsoleWG-Reviewed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions