You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Server OSes, If Carbon is present on the module load path and a script uses the Get-WindowsFeature cmdlet, it throws a CommandNotFoundException unless the ServerManager module is explicitly imported first.
To reproduce:
PS>Get-CommandGet-WindowsFeature
CommandType Name Version Source
----------------------------
Cmdlet Get-WindowsFeature2.0.0.0 ServerManager
PS>Install-Module Carbon -AllowClobber
PS>Get-WindowsFeatureGet-WindowsFeature : The term 'Get-WindowsFeature' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1+Get-WindowsFeature+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-WindowsFeature:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I realize Carbon probably implemented Get-WindowsFeature before ServerManager did, but sometimes it isn't possible to control what modules are loaded ahead of time, such as in OneGet/MicrosoftDockerProvider#26. The fact that a CommandNotFoundException occurs is also very confusing and hides the underlying issue.
Environment info:
Carbon: 2.6.0
OS: Windows Server 1607
$PSVersionTable:
Name Value
---------
PSVersion 5.1.14393.2515
PSEdition Desktop
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
BuildVersion 10.0.14393.2515
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
The text was updated successfully, but these errors were encountered:
brantb
changed the title
Carbon breaks the Get-WindowsFeature module when present on the system
Carbon breaks the Get-WindowsFeature command when present on the system
Oct 18, 2018
The plan is to add a C prefix to every Carbon command. To avoid breaking backwards compatibility, we're also adding a bunch of aliases from the old command names to the new command names. Since Carbon's manifest only lists the functions it exports and not any aliases, PowerShell's auto-module loading feature will no longer think Carbon has a Get-WindowsFeature command.
On Server OSes, If Carbon is present on the module load path and a script uses the
Get-WindowsFeature
cmdlet, it throws aCommandNotFoundException
unless theServerManager
module is explicitly imported first.To reproduce:
I realize Carbon probably implemented
Get-WindowsFeature
beforeServerManager
did, but sometimes it isn't possible to control what modules are loaded ahead of time, such as in OneGet/MicrosoftDockerProvider#26. The fact that aCommandNotFoundException
occurs is also very confusing and hides the underlying issue.Environment info:
$PSVersionTable
:The text was updated successfully, but these errors were encountered: