-
Notifications
You must be signed in to change notification settings - Fork 98
PSResourceGet installs nuget.org packages like they were PowerShell packages #1612
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
Comments
Here are the two tags used in PSRG to denote if a NuGet package is a module or script.
The logic should be updated check packages on a repo and fail if either of those tags aren't found. |
This seems to be by design: If neither a script or a module => Install as module. PSResourceGet/src/code/InstallHelper.cs Lines 1060 to 1067 in abfbf42
I don't understand that design decision. 🤔 |
We should be installing nupkgs to the nugetcache |
I don't know how much sense it makes to install NuGet packages handled by PSResourceGet into the NuGet cache.
I think it'd be better to add NuGet packages 1) handled by PSResourceGet 2) with intention of being consumed by PowerShell directly to a directory side by side with
Maybe PSResourceGet could use the NuGet cache to fetch packages from? Other questions: How to handle different package types (dependency vs. tool vs. template)?
Example dotnet-outdated-tool.nuspec<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>dotnet-outdated-tool</id>
<version>4.6.4</version>
<authors>dotnet-outdated Team & Contributors</authors>
<license type="expression">MIT</license>
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
<projectUrl>https://github.com/dotnet-outdated/dotnet-outdated</projectUrl>
<description>A .NET Core global tool to update project dependencies.</description>
<releaseNotes>See https://github.com/dotnet-outdated/dotnet-outdated/blob/master/CHANGELOG.md# for release notes.</releaseNotes>
<copyright>Copyright (c) Jerrie Pelser</copyright>
<packageTypes>
<packageType name="DotnetTool" />
</packageTypes>
<repository type="git" url="https://github.com/dotnet-outdated/dotnet-outdated.git" commit="3bad9cacfd8752a5d0a98fad47493c26bd8f5a88" />
</metadata>
</package> Example NuGet.Versioning.nuspec (it's a dependency, does not have "PackageTypes" inside it)<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>NuGet.Versioning</id>
<version>6.12.1</version>
<authors>Microsoft</authors>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<license type="expression">Apache-2.0</license>
<licenseUrl>https://licenses.nuget.org/Apache-2.0</licenseUrl>
<icon>icon.png</icon>
<readme>README.md</readme>
<projectUrl>https://aka.ms/nugetprj</projectUrl>
<description>NuGet's implementation of Semantic Versioning.</description>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>semver semantic versioning</tags>
<serviceable>true</serviceable>
<repository type="git" url="https://github.com/NuGet/NuGet.Client" commit="aa7eb9987d28e7169cfabfa484f2fdd22d2b91d2" />
<dependencies>
<group targetFramework=".NETFramework4.7.2" />
<group targetFramework=".NETStandard2.0" />
</dependencies>
</metadata>
</package> How to handle target framework?
|
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: