X Tutup
The Wayback Machine - https://web.archive.org/web/20230329061908/https://github.com/PowerShell/PowerShell/issues/18970
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

$EnabledExperimentalFeatures contains Microsoft.PowerShell.Utility.PSManageBreakpointsInRunspace #18970

Open
5 tasks done
sdwheeler opened this issue Jan 18, 2023 · 6 comments
Labels
Needs-Triage The issue is new and needs to be triaged by a work group. WG-Engine core PowerShell engine, interpreter, and runtime

Comments

@sdwheeler
Copy link
Collaborator

sdwheeler commented Jan 18, 2023

Prerequisites

Steps to reproduce

$EnabledExperimentalFeatures lists an experimental feature that is no longer experimental. The content of the variable should match the list of enabled items from Get-ExperimentalFeatures.

Expected behavior

PS> Compare-Object ($enabledExperimentalFeatures | Sort-Object) (Get-ExperimentalFeature | Where-Object Enabled | Select-Object -ExpandProperty Name | Sort-Object)

No difference

Actual behavior

PS> Compare-Object ($enabledExperimentalFeatures | Sort-Object) (Get-ExperimentalFeature | Where-Object Enabled | Select-Object -ExpandProperty Name | Sort-Object)

InputObject                                                SideIndicator
-----------                                                -------------
Microsoft.PowerShell.Utility.PSManageBreakpointsInRunspace <=

Error details

n/a

Environment data

I got the same results on 7.2.8, 7.3.1, and 7.4.0-preview.1.

Visuals

No response

@sdwheeler sdwheeler added the Needs-Triage The issue is new and needs to be triaged by a work group. label Jan 18, 2023
@mklement0
Copy link
Contributor

mklement0 commented Jan 18, 2023

To be clear, $EnabledExperimentalFeatures - which apparently isn't documented yet (see MicrosoftDocs/PowerShell-Docs#9722) - should obviously never surface obsolete experimental features, but as for why you're seeing it:

Presumably, your user-level powershell.config.json file ("$(Split-Path $PROFILE.CurrentUserAllHosts)/powershell.config.json") still lists this obsolete feature in its "ExperimentalFeatures" property, and removing it should make the problem go away.

That raises the question whether it's worth issuing a warning when an obsolete or invalid name is encountered (an invalid name is currently quietly ignored, unless its name starts with Microsoft. and is followed by at least one letter), at least in a session invoked with neither -File nor -Command

@sdwheeler
Copy link
Collaborator Author

My powershell.config.json file contains:

{
    "Microsoft.PowerShell:ExecutionPolicy": "Bypass",
    "ExperimentalFeatures": [
        "PSNullConditionalOperators",
        "PSSubsystemPluginModel",
        "PSDesiredStateConfiguration.InvokeDscResource",
        "PSAnsiRendering",
        "PSAnsiProgress",
        "PSAnsiRenderingFileInfo",
        "PSNativePSPathResolution",
        "Microsoft.PowerShell.Utility.PSManageBreakpointsInRunspace",
        "PSNativeCommandArgumentPassing",
        "PSStrictModeAssignment",
        "PSExec",
        "PSCustomTableHeaderLabelDecoration",
        "PSModuleAutoLoadSkipOfflineFiles",
        "PSNativeCommandErrorActionPreference"
    ]
}

So you can see there several features that have gone mainstream and two that have been removed. The question is why does "Microsoft.PowerShell.Utility.PSManageBreakpointsInRunspace" show up when the others don't.

@mklement0
Copy link
Contributor

mklement0 commented Jan 18, 2023

It probably is due to the magic that my previous comment alluded to (I haven't checked the source code): that Microsoft.-prefixed names, wether or not they refer to current or former experimental-feature names, are seemingly always surfaced in $EnabledExperimentalFeatures.

@237dmitry
Copy link

237dmitry commented Jan 19, 2023

$EnabledExperimentalFeatures is not string[]. That is why wrong comparing:

Screenshot 2023-01-19 105601

@mklement0
Copy link
Contributor

That Compare-Object doesn't recognize $EnabledExperimentalFeatures as enumerable is an interesting find and worth reporting as a bug in its own right.

However, it is incidental to the problem at hand, whose repro bypasses the issue by piping $EnabledExperimentalFeatures to Sort-Object first.

@mklement0
Copy link
Contributor

To close the tangent re $EnabledExperimentalFeatures not acting like an enumerable with Compare-Object: see #18990

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage The issue is new and needs to be triaged by a work group. WG-Engine core PowerShell engine, interpreter, and runtime
Projects
None yet
Development

No branches or pull requests

4 participants
X Tutup