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

Fully Qualify Install-Package command on website #9203

Merged
merged 5 commits into from
Aug 26, 2022

Conversation

potatoqualitee
Copy link
Contributor

Summary of the changes (in less than 80 characters):

  • Install-Package exists in both Microsoft's NuGet module and PackageManagement module. This clarifies which Install-Package is expected, which helps PowerShell end-users
  • Added a PowerShell tab to further clarify

Addresses #9201

@potatoqualitee potatoqualitee requested a review from a team as a code owner August 22, 2022 16:35
@@ -133,6 +135,15 @@
Id = Model.IsCakeExtension() ? "cake-extension" : "cake",
InstallPackageCommands = new [] { Model.GetCakeInstallPackageCommand() },
},

new PackageManagerViewModel("PowerShell")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a hypothesis that most NuGet packages does not make good PowerShell packages. My understanding is that the structure and contents of the packages are quite different. NuGet packages are essentially DLLs compiled against or used for build/deploy of .NET projects. PowerShell packages are .ps1 or module files for a PowerShell session. It might give folks the wrong impression if we mention PackageManagement\Install-Package. Wouldn't this command be more appropriate on PowerShell Gallery (https://www.powershellgallery.com/).

Copy link
Contributor Author

@potatoqualitee potatoqualitee Aug 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PowerShell community does indeed use nugets outside of Visual Studio. I use it enough to get frustrated with the fact that the command on the website doesn't work.

Steve Lee of the PS Team said

Installing arbitrary assemblies from http://nuget.org is something we want to support in PSGet v3.1 so after 3.0 is complete

Patrick Meinecke of the PowerShell team said

For now, I usually tell folks to build a binary module instead.
You can also build a csproj, add your dependencies, do dotnet publish and copy the dependencies out. It's not a great experience atm.

Another PS community member talks about how he handles nuget packages

A csproj file with PackageReference and a build.ps1 script to import the dependencies in the right location is still how I'm doing it. Not the best, but it works

So there is interest, and we do use it but it's not enjoyable (though as Steve mentioned, enhancements are coming soon). Ultimately, if there is a PowerShell tab, people like me will click it and it reenforces that the first tab isn't for us.

We use Install-Module on the PowerShell Gallery.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this additional context! I think we might be able to make quicker progress if we split this into two separate issues:

  1. Make NuGet\ prefix on the command with a note on why. This seems like obvious goodness to me since it at least helps people know that there's two Install-Package commands floating around in the world.
  2. Help PowerShell users know about how to use NuGet packages or, with that upcoming feature, use normal dependency NuGet packages (arbitrary DLLs) from PowerShell.

I'm concerned about item 2 because the vast majority of packages on NuGet.org don't work well with PowerShell's (or PSGet's) current feature set.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. When the feature is released, do you think we could add the PowerShell tab?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. When the feature is released, do you think we could add the PowerShell tab?

I think it would be quite reasonable to add! We need to consider the full scenario, get some input from the PowerShell team, etc, but I see know reason why this isn't in a similar category as the Cake or Paket categories. Essentially, it's not specifically NuGet client tooling involved but it is a scenario that has NuGet packages (from NuGet.org) in mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic news! I'll keep it on their radar /cc @SteveL-MSFT

@joelverhagen
Copy link
Member

@potatoqualitee, could you rebase this on dev branch? We merge all non-hotfix changes to dev first to allow it to reach our testing environment first as part of a CD (continuous deployment) flow.

@potatoqualitee potatoqualitee changed the base branch from main to dev August 23, 2022 00:38
@joelverhagen joelverhagen merged commit 64b7e10 into NuGet:dev Aug 26, 2022
@potatoqualitee potatoqualitee deleted the powershell branch August 26, 2022 17:15
@joelverhagen joelverhagen mentioned this pull request Aug 26, 2022
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants