Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Update License

view on GitHub

Update License is available as both a pgutil command and an HTTP Request, and will update a specified license.

Command Specification (CLI)

The licenses detection command set is used to update a license by adding or removing detection types. There are two commands available:

Command Description
add Adds a spdx, url, packagename or purl detection type
remove Removes a spdx, url, packagename or purl detection type`

The --code, --type, and --value options are always required.

Adding a PUrl detection type to a license requires the license code (e.g. ABC-1.0), the detection type (e.g purl), and the value (e.g. pkg:nuget/myNugetPackage@1.2.3):

pgutil licenses detection add --code=ABC-1.0 --type=purl --value=pkg:nuget/myNugetPackage@1.2.3

Removing an SPDX detection type to a license requires the license code (e.g. ABC-1.0), the detection type (e.g spdx), and the value (e.g. MIT):

pgutil licenses detection remove --code=ABC-1.0 --type=spdx --value=MIT

Updating License Files

The licenses files command set is used to add, remove, or view license files in a license. There are two commands available:

Command Description Required Options
add Uploads a license file to ProGet --code, --file
delete Removes a license file from ProGet --hash

Adding a license file to a license requires the license code (e.g. ABC-1.0) and the file (e.g. C:\documents\license-files\abc-1.0-license-file.txt):

pgutil licenses files add --code=ABC-1.0 --file=C:\documents\license-files\abc-1.0-license-file.txt

Deleting a license file requires the license file's hash (e.g. 00462de3d7b6f3e5551a69ae84344bc69d23c02e1353be3e8445d16f025e523b):

pgutil licenses files delete --hash=00462de3d7b6f3e5551a69ae84344bc69d23c02e1353be3e8445d16f025e523b

HTTP Request Specification

To update a license, simply POST to the URL with the license ID, an appropriate API Key and a LicenseInfo.cs object as the request body.

This endpoint supports partial updating by only updating the properties that are supplied in the request.

POST /api/licenses/update

HTTP Response Specification

A successful 200 response body will contain an updated LicenseInfo.cs object. A 403 response indicates a missing, unknown, or unauthorized API Key. A 404 response indicates that the specified license does not exist.