Skip to content

Get-WindowsOptionalFeature -Online fails on PowerShell from MSIX installation - [Get-WindowsOptionalFeature: Class not registered] #13866

@brwilkinson

Description

@brwilkinson

Steps to reproduce

Get-WindowsOptionalFeature -Online

>Get-WindowsOptionalFeature: Class not registered

get-error

Exception             :
    Type       : System.Runtime.InteropServices.COMException
    ErrorCode  : -2147221164
    TargetSite :
        Name          : ThrowTerminatingError
        DeclaringType : System.Management.Automation.MshCommandRuntime, System.Management.Automation, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
        MemberType    : Method
        Module        : System.Management.Automation.dll
    StackTrace :
   at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
    Message    : Class not registered

    Source     : System.Management.Automation
    HResult    : -2147221164
CategoryInfo          : NotSpecified: (:) [Get-WindowsOptionalFeature], COMException
FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsOptionalFeatureCommand
InvocationInfo        :
    MyCommand        : Get-WindowsOptionalFeature
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 1
    Line             : Get-WindowsOptionalFeature -Online
    PositionMessage  : At line:1 char:1
                       + Get-WindowsOptionalFeature -Online
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Get-WindowsOptionalFeature
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Expected behavior

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core

Get-WindowsOptionalFeature -Online

FeatureName : Printing-PrintToPDFServices-Features
State       : Enabled

FeatureName : Windows-Defender-Default-Definitions
State       : Disabled

FeatureName : Printing-XPSServices-Features
State       : Enabled

...

Actual behavior

Error: Get-WindowsOptionalFeature: Class not registered

Environment data

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.0-rc.2
PSEdition                      Core
GitCommitId                    7.1.0-rc.2
OS                             Microsoft Windows 10.0.20211
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productKeepOpenThe bot will ignore these and not auto-closeOS-WindowsPackage-MSIXIssue occurs with MSIX packageWG-Maintainers-Buildspecific to affecting the buildWG-NeedsReviewNeeds a review by the labeled Working Group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions