PowerShell / WindowsCompatibility

Module that allows Windows PowerShell Modules to be used from PSCore6
Other
137 stars 33 forks source link

DISM commands not compatible #87

Open panos-coupa opened 3 years ago

panos-coupa commented 3 years ago

Some commands in the DISM module are not running

for example:

PS C:\Windows\System32> Get-WindowsCapability -Online
Get-WindowsCapability: Class not registered

PS C:\Windows\System32> Get-WindowsOptionalFeature -Online
Get-WindowsOptionalFeature: Class not registered

Same goes for Remove-WindowsOptionalFeature and Remove-WindowsCapablility

My system is: Windows 10 Enterprise v2004 My Powershell is: PowerShell 7.1.0-rc.2

Thanks for your time

Alsiri0n commented 3 years ago

PowerShell 7.1.2 confirm this behavior. At PS 5.1 not problem with this comandlet I try to run this command at PS 7 Get-WindowsCapability -Online -LogPath "%WINDIR%\Logs\Dism\capability.log" -LogLevel WarningsInfo| ? Name -like 'OpenSSH' and try to run this command at PS 5 Get-WindowsCapability -Online -LogPath "%WINDIR%\Logs\Dism\capability5.log" -LogLevel WarningsInfo| ? Name -like 'OpenSSH' capability5.log capability.log Logs attached.

jschpp commented 3 years ago

Since I stumbled about somthing like this some time ago it would be interesting if the problem persits if you load the dism module with -SkipEditionCheck

DShader commented 3 years ago

-SkipEditionCheck is not available as a parameter for the Get-WindowsCapability command. -verbose and -debug do nothing as well

jschpp commented 3 years ago

My mistake. I wasn't quite clear enough.

You need to import the Module like this:

Import-Module -SkipEditionCheck DISM