Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
PGSCAN Utility Questions
-
I have several questions on how the PG Scan utility works that the documentation doesn't immediately answer for me.
suppose I am calling the pgscan utility....
& $pgscanDir\pgscan.exe Publish --type=$pkgType --input=$solutionName --package-feed=$feedName --proget-url=$progetURL --consumer-package-source=$sourceFeedName --consumer-package-name=$packageName --consumer-package-version=$releaseNumber --consumer-package-group=$devCodeName --api-key=$apiKey
- What actually belongs in the consumer-package-name and consumer-package-version fields? I had assumed that this was supposed to be the package that I was using, such as Newtonsoft.Json. Is it actually supposed to represent my application?
- How does pgscan handle subprojects and submodules when I call it from the .sln level? Say MyProject.sln has a subproject1.csproj, and uses submodule1.sln . How would pgscan report the nuget packages that are used?
- How do I remove dependencies from packages once I register them? I'm fairly certain that I did all of these wrong and need to wipe the entire slate clean.
-
Hi @arozanski_1087 , happy to help!
Hopefully we can update the documentation with these improvements.
What actually belongs in the consumer-package-name and consumer-package-version fields?
This is supposed to represent your application.
pgscan
will detect the packages that your application uses, likeNewtonsoft.JSON
and the version of that package.How does pgscan handle subprojects and submodules when I call it from the .sln level?
When you point
pgscan
to a.sln
file, it will parse the file and look for projects. Under each project, the tool will look forpackages.config
(which is the older style project format) and thenproject.assets.json
(which is the newer style).How do I remove dependencies from packages once I register them?
This isn't currently supported it seems (I don't see a delete button in the UI), but if you don't mind going to the database, you can just do
DELETE [PackageDependents]
and then all the rows are cleared.
-
@atripp Thank you for getting back to me! This is incredibly helpful.
When you point pgscan to a .sln file, it will parse the file and look for projects. Under each project, the tool will look for packages.config (which is the older style project format) and then project.assets.json (which is the newer style).
Does this register submodules and subprojects individually under the group name? Using my previous example: would all the nuget dependencies get registered under MyProject1, or would I see Myproject1\submodule1 as how it's registered? If it doesn't do the latter, what would you recommend me do in order to achieve that state?
This isn't currently supported it seems (I don't see a delete button in the UI), but if you don't mind going to the database, you can just do DELETE [PackageDependents] and then all the rows are cleared.
I don't mind going into the DB to fix my massive mistake. Is there a place I can feature request this as a UI addition?
-
Hi @arozanski_1087,
Whatever
consumer-package-name
andconsumer-package-source
you set as a parameter topgscan
is what the packages will be associated with.Basically, the utility has the effect of doing this...
- Reading the sln file you specify
- Finding all NuGet packages
- Locating those packages in ProGet
- Adding a "package consumer" to the NuGet package with the "consumer" information (MyProject?).
To get the behavior you want, you may need to call
pgscan
multiple times with different "consumer" information, or even modify the tool / cusotmize something that calls the API directly.Good point about delete button; I added a change (PG-1957) where we'll get that as a UI Addition.
-
Thank you @atripp! Using the utility multiple times isn't an issue for us. I'll find some way of making that work.
Thank you again for your assistance here.
-
@arozanski_1087 no problem!
And by the way, the
pgscan
tool is open source, so if you see opportunities to improve it, or want to devleop something on your own, please don't hesitate to use the sources - https://github.com/Inedo/pgscan