PowerShell / PowerShellGet

This module provide functions used with PowerShellGet v3 to provide compatibility with scripts expecting PowerShellGet v2
MIT License
49 stars 13 forks source link

`Get-PSRepository`: Does not return `InstallationPolicy` property #39

Open johlju opened 10 months ago

johlju commented 10 months ago

Prerequisites

Steps to reproduce

When using PowerShellGet the command will return these properties, note InstallationPolicy for example.

PS> Get-PSRepository -Name 'PSGallery' | fl *

Name                      : PSGallery
SourceLocation            : https://www.powershellgallery.com/api/v2
Trusted                   : False
Registered                : True
InstallationPolicy        : Untrusted
PackageManagementProvider : NuGet
PublishLocation           : https://www.powershellgallery.com/api/v2/package/
ScriptSourceLocation      : https://www.powershellgallery.com/api/v2/items/psscript
ScriptPublishLocation     : https://www.powershellgallery.com/api/v2/package/
ProviderOptions           : {}

But when using CompatPowerShellGet it missing a lot of properties that scipts could be expecting, in my case InstallationPolicy.

 Get-PSRepository -Name 'PSGallery' | fl *

Name           : PSGallery
Uri            : https://www.powershellgallery.com/api/v2
Trusted        : False
Priority       : 50
CredentialInfo : 
ApiVersion     : v2

Expected behavior

# To return the same properties as PowerShellGet

Actual behavior

# Does not return the expected property InstallationPolicy.

Error details

# n/a

Environment data

Name                           Value
----                           -----
PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Darwin 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:21:56 PDT 2023; root:xnu-8796.141.3~6/R…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

0.0.4

Visuals

None.