Package Manager

Welcome Forums General PowerShell Q&A Package Manager

This topic contains 5 replies, has 3 voices, and was last updated by

 
Participant
1 month, 1 week ago.

  • Author
    Posts
  • #120904

    Participant
    Points: 45
    Rank: Member

    I'm attempting to use the built-in package management functions in powershell version 5, however I'm running into an interesting issue, using the "get-package pagkagename" process, I'm getting the following prompt:

    The provider 'nuget v2.8.5.208' is not installed.

    nuget may be manually downloaded from https://oneget.org/Microsoft.PackagaeManagement.NuGetProvider-2.8.5.208.dll and installed.

    Would you like PackageManagement to automatically download and install 'nuget' now?

    Why is this?  What am I missing?  I'm trying to look at an *.msi package that was installer or see if it's installed?  Is this possible to do without the 'nuget' package?

     

     

  • #120910

    Participant
    Points: 879
    Helping Hand
    Rank: Major Contributor

    PowerShell package management(PowerShellGet) uses nuget, hence it has to be installed if you want to use PowerShellGet

    • #120912

      Participant
      Points: 45
      Rank: Member

      After digging into this a little further, I found that this is indeed not the case,

      "GetPackage Provider Programs IncludeWindowsInstaller -Name PackageName" works great!  

      Thank you for the input though.  I'm using this in an internal/secure environment, where we want to keep the outside sources to a minimum.

       

  • #120918

    Participant
    Points: 879
    Helping Hand
    Rank: Major Contributor

    Yup, What I mentioned is about 'PoweerShellGet' package provider. Here you use 'Programs' provider to get installed MSI package. There are more package providers, you can get it using 'Get-PackageProvider' cmdlet.

    • #120928

      Participant
      Points: 45
      Rank: Member

      Agreed.  As I stated in my initial question, I was attempting to look at locally installed packages, via *.msi packages.  I didn't look deep enough into selecting a single local package "Programs" provider.

       

      Thanks again!!

  • #121483

    Participant
    Points: 320
    Helping Hand
    Rank: Contributor

    Yep, just using..

    Get-Package

    … all by itself would show that as well.

    Just curious, what OS are you running and what version of PS?

    The reason I ask, is because, by design on pre-Win10 and pre-PS5x, you had to download and install the Windows PowerShell Package Manager https://blogs.msdn.microsoft.com/powershell/2016/03/08/package-management-preview-march-2016-for-powershell-4-3-is-now-available ( for PSv4 – which included the *package, *module, etc. were included) and it would automatically install nuget as per the MS docs, which kvprasoon addressing.

    MS on Win10 and PS5, PSGet is already there and so, you would not have been prompted for that nuget thingy.  There are some packages in nuget repo that are not available in PSGet, so, there is a reason to have it if there are packages you find online, the don't come up in the normal PSGet stuff. I have never personally needed nuget either, but I've messed with it just in case.

    And of course the MSDocs are pretty specific about what...

    https://docs.microsoft.com/en-us/powershell/module/packagemanagement/get-package?view=powershell-6

    ...can give you in your use case, that you've already discovered.

    What I've always really found odd is why MS did not include that sort of stuff in the Find-Package cmdlet.

You must be logged in to reply to this topic.