Skip to content
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

PowerShell module does not work in PowerShell 5.1 #173

Open
ghost opened this issue Sep 27, 2022 · 1 comment
Open

PowerShell module does not work in PowerShell 5.1 #173

ghost opened this issue Sep 27, 2022 · 1 comment
Assignees
Labels
Issue-Docs Improvements or additions to documentation

Comments

@ghost
Copy link

ghost commented Sep 27, 2022

Brief description of your issue

The Microsoft.WinGet.Source.psd1 module will not load with PowerShell 5.1. It fails with the following error:

Add-Type : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more
information.
At C:\src\winget-cli-restsource\Tools\PowershellModule\src\Microsoft.WinGet.Source.psm1:24 char:17
+ ...             Add-Type -Path "$PSScriptRoot\Library\HelperLib\x64\Micro ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
    + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeComma
   nd

LoaderExceptions contains the following missing dependencies:

Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or
one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or
one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or
one of its dependencies. The system cannot find the file specified.

The README.md does not make any mention that PowerShell 5.1 is not supported and that you need a newer version of PowerShell. (It loaded for me fine in PowerShell 7, after working around #172. :))

This is not called out in the documentation as a prerequisite.

@ghost ghost added the Issue-Docs Improvements or additions to documentation label Sep 27, 2022
@RDMacLachlan
Copy link
Member

Thank you for the feedback @ameltzerMSFT , we will update the documentation to include the missing prerequisite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant