You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 20, 2021. It is now read-only.
For example, note in this trace that the second call to Install-Package correctly detects the package is already installed, but there's no way for me to get the information from the installed package (e.g. what source it came from), and the output of Install-Package doesn't even have the install location.
This is wrong ...
PS> $Package = @{
Name = "Newtonsoft.Json"
ProviderName = "NuGet"
Source = "https://www.nuget.org/api/v2"
}
PS> $Options = @{
Destination = $PWD
ExcludeVersion = $true
PackageSaveMode = "nuspec"
Force = $true
Verbose = $true
}
PS> Install-Package @Package @Options
VERBOSE: NuGet: Installing 'Newtonsoft.Json 7.0.1'.
VERBOSE: NuGet: Successfully installed 'Newtonsoft.Json 7.0.1'.
Name Version Source Summary
---- ------- ------ -------
Newtonsoft.Json 7.0.1 NuGet
PS> Install-Package @Package @Options
VERBOSE: NuGet: Package "Newtonsoft.Json" is already installed.
VERBOSE: Skipped Package 'Newtonsoft.Json v7.0.1' already installed
PS> Get-Package @Package @Options
Get-Package : A parameter cannot be found that matches parameter name 'Source'.
At line:1 char:13
+ Get-Package @Package @Options
+ ~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-Package], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackage
PS> $Package.Remove("Source")
PS> Get-Package @Package @Options
Get-Package : No package found for 'Newtonsoft.Json'.
At line:1 char:1
+ Get-Package @Package @Options
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power...lets.GetPackage:GetPackage) [Get-Package], Exception
+ FullyQualifiedErrorId : NoMatchFound,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackage
The text was updated successfully, but these errors were encountered:
Hi Jay, Get-Package for nuget requires a destination parameter. That's why it didn't work. Have you tried Get-Package -ProviderName nuget -Destination ?
If you look at my sample code, you'll see I provided it the exact same parameter hashtable as I did to Install-Package (except that I had to remove the Source parameter).
Hi jay, sorry for overlooking that. We actually had a fix for this issue (just hasn't been released yet). Also, in the last community meeting, we have communicated to the community that we are rewriting our own nuget package provider so that it will run on nano server. We remove the PackageSaveMode option from the new nuget provider, will this affect your existing scripts?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For example, note in this trace that the second call to Install-Package correctly detects the package is already installed, but there's no way for me to get the information from the installed package (e.g. what source it came from), and the output of Install-Package doesn't even have the install location.
This is wrong ...
The text was updated successfully, but these errors were encountered: