mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix PackageManagement issue in the latest Alpah12 on Linux (#2665)
* Registry.LocalMachine throws on non-windows platform. * address cr feedback
This commit is contained in:
@@ -1037,10 +1037,15 @@ namespace Microsoft.PackageManagement.Internal.Implementation {
|
||||
throw new ArgumentNullException("request");
|
||||
}
|
||||
|
||||
#if CORECLR
|
||||
var providerAssemblies = Enumerable.Empty<string>();
|
||||
|
||||
#else
|
||||
//looks like registry needs to be here for supporting .msi packages
|
||||
var providerAssemblies = (_initialized ? Enumerable.Empty<string>() : _defaultProviders)
|
||||
.Concat(GetProvidersFromRegistry(Registry.LocalMachine, "SOFTWARE\\MICROSOFT\\PACKAGEMANAGEMENT"))
|
||||
.Concat(GetProvidersFromRegistry(Registry.CurrentUser, "SOFTWARE\\MICROSOFT\\PACKAGEMANAGEMENT"));
|
||||
#endif
|
||||
|
||||
#if !COMMUNITY_BUILD
|
||||
// todo: these should just be strong-named references. for now, just load them from the same directory.
|
||||
|
||||
Reference in New Issue
Block a user