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
As you can add any nuget v2 and v3 repository to PSResourceGet, maybe it would be smart to validate whether packages are ment for PowerShell before installing?
Take NuGet.Versioning for instance, it installs to $env:PSModulePath as a PowerShell module, but can't be imported as a module.
Steps to reproduce:
# Register NuGet as a resource repositoryRegister-PSResourceRepository-Name 'NuGet'-Priority 60-Uri 'https://api.nuget.org/v3/index.json'# Find latest version of NuGet.Versioning from nuget.orgFind-PSResource-Repository 'NuGet'-Name 'NuGet.Versioning'|Format-List# Install itInstall-PSResource-Scope 'CurrentUser'-Repository 'NuGet'-TrustRepository -Name 'NuGet.Versioning'# Find it locallyGet-InstalledPSResource-Name 'NuGet.Versioning'|Format-List# Try to import it - Does not workImport-Module-Name 'NuGet.Versioning'# One can add it as type though## Find info for latest installed version$NuGetVersioning=Get-InstalledPSResource-Name 'NuGet.Versioning'|Sort-Object-Property 'Version'-Descending |Select-Object-First 1## Add typeAdd-Type-Path ([System.IO.Path]::Combine($NuGetVersioning.'InstalledLocation','NuGet.Versioning',$NuGetVersioning.Version.ToString(),'lib','netstandard2.0','NuGet.Versioning.dll'))
## Test it
[NuGet.Versioning.NuGetVersion]'1.2.3'
Prerequisites
Steps to reproduce
As you can add any nuget v2 and v3 repository to PSResourceGet, maybe it would be smart to validate whether packages are ment for PowerShell before installing?
Take NuGet.Versioning for instance, it installs to
$env:PSModulePath
as a PowerShell module, but can't be imported as a module.Steps to reproduce:
Related comments:
Expected behavior
Validate whether a package is made for PowerShell. Tags? Content when decompressed?
Alternatively, do something else with non-PowerShell NuGet packages? Add to different path or something.
Actual behavior
Installs non-PowerShell resources as if they were modules.
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: