VS Nuget Package Manager commands on OSX
See original GitHub issueI’m super excited about the release of PowerShell for Mac and Linux–congrats!
However, I ran into some trouble trying to use Nuget commands. Lots of documentation on NuGet packages seems to assume that you’re using Windows and the VS Package Manager Console, so I was looking forward to being able to follow these sorts of examples in a straightforward manner when developing for ASP.Net on OSX (example: adding a package to my project through the command line, like Install-Package <Package-Name>
)
Here’s what I did, hoping it would work…
- Installed PowerShell using .pkg installer on OS X
- Opened a terminal and entered
powershell
- Typed
Install-Package -ListAvailable
, which was suggested as something you could do with the Package Manager Console. - Got this error:
Get-Package : A parameter cannot be found that matches parameter name 'ListAvailable'.
So it looks like the Get-Package
command is something that PowerShell recognizes, but it doesn’t behave the same way as it does in the VS Package Manager Console.
@vors commented on this issue at @shanselman’s blog:
PowerShell nuget package manager (the one from Visual Studio) has cmdlet’s name collisions with PowerShellGet (PS package manager), which you run in PowerShell on OS X. They essentially provide the same functionality for different scopes (project vs the whole system), but available parameters are different. It’s indeed confusing, we are sorry.
I’m kind of new to PowerShell, so I don’t know if making this work would require changes with PowerShell itself, or if there is something I can do to my configuration let it know that I want to behave similar to the VS Package Manager Console. Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
I followed that tutorial from the outset, but running the Install-Package command as specified requires nuget is already working. That is where I am stuck.
Someone has obviously got this working - I guess someone that needs nuget daily, and by the time they installed powershell on their Mac installing nuget was a distant memory.
I probably only need it this once, so I can admin Azure from my home Mac. I wouldn’t class that as production - I have Windows 10 at work. Still, it’s frustrating to get stuck at this stage. It’s alpha, so I’m sure it will get there eventually.
Thanks,
Dunxd
On Tue, 15 Nov 2016 7:09 pm Gavin, notifications@github.com wrote:
Hi Please use the following tutorial.
https://blogs.technet.microsoft.com/jessicadeen/azure/getting-started-with-powershell-core-and-azurerm-modules-on-ubuntu-and-os-x/
The Azure PS modules have not been released for .net core / powershell core as it still alpha however this will let you use the preview modules.
Powershell .net core is still alpha and does not have all the features you’re looking for.
Nuget works in power shell core however it is different syntax than Visual Studio ( You might get visual studio on the Mac tomorrow and be able to use Nuget but I doubt it also as this will be alpha )
Regardless if you need powershell in a prod environment spin up a windows VM as thats the only currently supported solution
On Tue, Nov 15, 2016 at 6:54 PM, Steve Lee notifications@github.com wrote: