-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
DISM cmdlets not working in Powershell 7 #15428
Comments
Yes, I was on build 21376, and I'm not on 21390 and it is still there. Also, apparently it seems to recognize the command when I'm running without elevation.
But this is different to the output on Powershell 5.1
It's like Powershell 7 recognizes the cmdlet itself that it requires elevation, but doesn't know it's function. |
This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes. |
I can reproduce exactly the same issue using the following version: When I run without Administrator privileges I obtain this: And with Administrator privileges I obtain this: Worth mentioning that if I use Windows PowerShell: I can run the command successfully, although only with Administrator privileges: |
@TravisEz13 I was able to repro this in a Windows 10 Pro VM on Azure (after installing Powershell 7): (I was following this guide). |
This works well for me. Can you check on fresh Windows 10? |
I can't right now because I have a lot of apps required for work |
I can duplicate this issue on Windows 11 and just updated last night. It's quite irritating as I can't get VS Code SSH setup for a critical work issue. I was able to get SSH loaded by going through the control panel though. It takes QUITE a long time as well. More details:
|
Running latest Insiders Win 11 build (22557) and it works as expected: PS C:\Foo> $PSVersionTable
Name Value
---- -----
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.22557
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.10032.0, 6.0.0, 6.1.0, 6.2.0, 7.0.0, 7.1.0, 7.2.1}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS C:\Foo> Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
Name : OpenSSH.Client~~~~0.0.1.0
State : Installed
Name : OpenSSH.Server~~~~0.0.1.0
State : NotPresent |
Why is this closed? It's still a bug. |
@doctordns Interesting, as near as I can tell our versions were identical. I don't use PS that much (I use JPSoft's TCC), so maybe there's something you've installed that I didn't - that Get-WindowsCapability doesn't check for but relies on. |
The DISM module is a Windows PowerShell module, NOT a PowerShell 7 module. I see this: PS C:\Foo> Get-WindowsCapability -Online | ft
Name State
---- -----
Accessibility.Braille~~~~0.0.1.0 NotPresent
Analog.Holographic.Desktop~~~~0.0.1.0 NotPresent
App.StepsRecorder~~~~0.0.1.0 Installed
App.WirelessDisplay.Connect~~~~0.0.1.0 NotPresent
Browser.InternetExplorer~~~~0.0.11.0 Installed
DirectX.Configuration.Database~~~~0.0.1.0 NotPresent |
I see this, running in an elevated prompt:
|
It's really simple. You should be able to install PowerShell 7, on a new machine, and it should work. If it doesn't, either it's not installing enough 'stuff' or the error message needs to indicate what does need to be installed. Empty stubs do no one any good. My bets on a bad install program.
|
That sounds like a borked Windows. Class not registered means that something is missing from your windows installation. The DISM cmdlets are shipped with Windows and the installation should properly register any classes needed. One suggestion is an upgrade-install. Use the ISO of your current windows version and use it "upgrade" your existing installation. this should re-register the class. Or just do a fresh install and move on. |
My windows is not borked. It was a fresh install. It works fine for everything else. YOUR windows looks like it's been upgraded over the years - you probably installed something a long time ago, that a fresh install doesn't install. I installed OpenSSH another way, and everything is fine - and most other PowerShell things work fine. Have YOU tried a fresh install on a new box? |
I don't know why this issue is closed. I'm experiencing the same thing.
Update: |
The reason the issue is closed (here) is that this is not a PowerShell issue. The module is/was a Windows PowerShell module. It appears in later versis of Windows, the module works fine (assumein elevation). This is not an issue we can fix. |
As this was the first result in a web search of this issue, I want to add how I resolved my issue. On a fresh install of Windows 11, I installed PowerShell 7 from the Microsoft Store. After reading Nytrona's comment, I removed the PowerShell install from the Microsoft Store and downloaded the MSI from Github. Both are 7.3.0, but the issue was resolved by installing the MSI instead. In my case, this was a Microsoft Store issue and not a PowerShell issue. |
It certainly is - rez9x showed it's a PowerShell in the Microsoft Store issue. That's still a Microsoft issue. Having an incorrect install I would think is still a PowerShell install. How does anyone else in the company know what to install if you guys don't give them the right install? Seems weird. And you know, it doesn't matter if "it works on my machine" kind of crap. It's a MICROSOFT issue. If you're going to close a real issue, you should at least open another issue with the correct group. This kind of "closed because it's not a problem" is utterly rife with the new Microsoft. What happened? You guys used to be a great company. Now, people complain endlessly about stupid crap that should be a trival fix and the attitude is "closed due to Triage" (that's not what Triage is!) or "not our problem". It's all your problem. Fix your stuff. Somehow. |
"Fucking shit Microsoft" others might be saying, but not me. I like Microsoft and its support. |
So the official advice from microsoft, is to not trust the microsoft store to install things correctly? |
I suspect the best advice is that you have many ways to install PowerShell 7. Some come with limitations based on the underlying delivery mechanisms. You need to choose what is best for your organisation. Personally, I use the |
I can confirm that using |
@rizolo That's because winget installs the .msi Version of Powershell. But this issue is about the appx (UWP) version of powershell which can be obtained via Microsoft Store. While the powershell appx version 5.1 works, Powershell 7.2.6 and 7.3.0-preview.8 don't. I didn't test the final powershell 7.3.0 version. |
@doctordns It is fine if this topic is too complicated for you and you don't understand what is going on, but understand that this is a real issue that should be tackled so reopen this issue or remove powershell from store and or do not provide an UWP version. |
It's bureaucracy and that the teams within many large companies don't really work together/communicate properly or at all.. I'm probably mixing observations with the other very similar issue #13138 where exactly the same root causes lead the maintainers to say "We dont care, not our problem, ok, closed" |
Just FYI, the "Class not registered" error happens in PowerShell installed from MS Store is likely due to the registry virtualization applied to Store apps, see #13866 (comment). The issue is tracked by #13866, and this is the latest updates on that issue: #13866 (comment) |
I can confirm that deleting the msstore version corrected this issue for me. |
Steps to reproduce
Type
Expected behavior
Actual behavior
Environment data
Powershell 5.1 (working)
Powershell 7 (installed from Store)
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.
The text was updated successfully, but these errors were encountered: