question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DISM cmdlets not working in Powershell 7

See original GitHub issue

Steps to reproduce

Type

Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'

Expected behavior

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\Administrator> Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'


Name  : OpenSSH.Client~~~~0.0.1.0
State : Installed

Name  : OpenSSH.Server~~~~0.0.1.0
State : NotPresent

Actual behavior

PowerShell 7.2.0-preview.5
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS C:\openssh> Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
Get-WindowsCapability: Class not registered

Environment data

Powershell 5.1 (working)

PS C:\Users\Administrator> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.21376.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.21376.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Powershell 7 (installed from Store)

PS C:\openssh> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.0-preview.5
PSEdition                      Core
GitCommitId                    7.2.0-preview.5
OS                             Microsoft Windows 10.0.21376
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Additional Notes

Referenced in Powershell/WindowsCompatibility#87 I wasn’t sure if it was the right place to report this issue, so I’m reporting here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:32 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
msftbot[bot]commented, May 29, 2021

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

5reactions
jgwinnercommented, Feb 25, 2022

Why is this closed? It’s still a bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DISM not working
DISM not working. When I run any of the DISM commands in either CMD or Powershell, it opens an empty powershell window.
Read more >
Use DISM in Windows PowerShell
The Deployment Image Servicing and Management (DISM) cmdlets can be used to perform the same functions as the DISM.exe command-line tool. In ...
Read more >
PowerShell 7 module compatibility
This article lists the compatibility status of modules published for other Microsoft products with PowerShell 7.
Read more >
Most of powershell commands not working
So I ran the DISM+SFC+Chkdsk+Reboot gamut, no luck. Reinstall/Repair .NET, no change. PSModule paths, etc. etc. no fix. Digging further, read up ...
Read more >
'Get-WindowsDriver' is not recognized as the name of a ...
I'm on Windows 10 x64 so my PowerShell automation code based on DISM / Get-WindowsDriver cmdlet will only run successful (without exceptions) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found