~ 5.x PowerShell version by default contains the source of the nuget package, but it does not work:
PS > Get-PackageSource Name ProviderName IsTrusted Location ---- ------------ --------- -------- nuget.org NuGet False https://api.nuget.org/v3/index.json PSGallery PowerShellGet False https://www.powershellgallery.com/api/v2/
If you are Unregister-PackageSource -Name nuget.org and Register-PackageSource -Location https://www.nuget.org/api/v2 -Name nuget.org -Trusted I was able to install nuget papckages using Install-Package from PowerShell, and not into a visual studio. Got an idea from this SO answer .
I don’t know what other possible negative consequences there are for removing the vgen nuget.org version of the v3 version, but I have been working this way for a while, and everything looks fine, your mileage may vary.
As an alternative, here is an example that does this work by pulling out nuget.exe, even if it's a shortcut way to do this:
function Install-InvokeOracleSQL { $ModulePath = (Get-Module -ListAvailable InvokeSQL).ModuleBase Set-Location -Path $ModulePath if ($PSVersionTable.Platform -ne "Unix") { $SourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" $TargetNugetExe = ".\nuget.exe" Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe .\nuget.exe install Oracle.ManagedDataAccess Remove-Item -Path $TargetNugetExe } elseif ($PSVersionTable.Platform -eq "Unix") { nuget install Oracle.ManagedDataAccess.Core -Version 2.12.0-beta2 } }
source share