PowerShell / PSResourceGet

PSResourceGet is the package manager for PowerShell
https://www.powershellgallery.com/packages/Microsoft.PowerShell.PSResourceGet
MIT License
489 stars 94 forks source link

Can't import PowerShellGet on Windows Server 2016 #1038

Closed jdhitsolutions closed 1 year ago

jdhitsolutions commented 1 year ago

Prerequisites

Steps to reproduce

This started as a discussion item but it has been unanswered and I couldn't find any related issues.

Running Windows Server 2016, Server Core.

 PS C:\> $psversiontable

Name                           Value
----                           -----
PSVersion                      5.1.14393.2273
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.2273
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

I installed v3.0.19-beta19.

PS C:\> get-module powershellget -ListAvailable | Select Version,Name

Version Name
------- ----
3.0.19  PowerShellGet
2.2.5   PowerShellGet
1.0.0.1 PowerShellGet

But it fails to import.

PS C:\> Import-Module PowerShellGet -RequiredVersion 3.0.19 -verbose
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\3.0.19\PowerShellGet.psd1'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\3.0.19\PSGet.Format.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module PowerShellGet.
VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\3.0.19\./netstandard2.0/PowerShellGet.dll'.
Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or
one of its dependencies. The system cannot find the file specified.
    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

If there is a requirement for PowerShellGet, then it needs to be documented and put in the module manifest if appropriate.

Expected behavior

I expect the module to be imported. Or document module requirements.

Actual behavior

Missing assembly error.

Error details

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

Environment data

Version Name
------- ----
3.0.19  PowerShellGet

Name                           Value
----                           -----
PSVersion                      5.1.14393.2273
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.2273
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Visuals

No response

jdhitsolutions commented 1 year ago

This does not appear to be an issue in Windows PowerShell on Windows Server 2019.

SydneyhSmith commented 1 year ago

Thanks for opening this issue @jdhitsolutions can you confirm this repros with beta20, we built this against a different version of .Net and have fewer dependencies

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.