So I am trying to use both the -verbosity and -version option together on the nuget command line. I need to use both and then parse the output of the verbosity log (this will determine other behaviors). So it is important that I get the verbose log. But for version control and making sure I can download the necessary packages again if need be I need to be able to specify -version.
Here is my commands and outputs:
(with only verbosity)
[C:\Users\C\Downloads]nuget install prism.PubSubEvents -verbosity detailed
GET https://www.nuget.org/api/v2/FindPackagesById()?$filter=IsLatestVersion&$orderby=Version desc&$top=1&id='prism.PubSubEvents'
GET https://www.nuget.org/api/v2/Packages(Id='prism.PubSubEvents',Version='1.1.2')
Installing 'Prism.PubSubEvents 1.1.2'.
Successfully installed 'Prism.PubSubEvents 1.1.2'.
(with both, after deleting the folder I just downloaded)
[C:\Users\C\Downloads]nuget install prism.PubSubEvents -verbosity detailed -version 1.0.0
Installing 'Prism.PubSubEvents 1.0.0'.
Successfully installed 'Prism.PubSubEvents 1.0.0'.
Switching the order of the options around and also it doesn't matter if I specify and older version or even the newest version.
Any help would be greatly appreciated.
I am returning to answer this in case anyone else finds it.
As it turns out, nuget caches all packages which are downloaded in %APPDATA%Local\NuGet\Cache
and looks there first before going to download any packages from the web. That is why no output was coming out, because it doesn't say that is is looking in the cache and just picks them up from there without going to the web.
However, you can choose to ignore the cache with the -nocache
option. This will always give you some kind of verbose output (although it is a little unpredictable)