@echo off setlocal rem Do not give extension. rem rem O your-spdx-sbom-file rem X your-spdx-sbom-file.json set target_sbomfile=%1 set target_sbomfile_full=%target_sbomfile%.json if exist "%target_sbomfile_full%" ( rem ) else ( echo target_sbomfile DOES NOT EXISTS: %target_sbomfile_full% pause exit /b 1 ) jq . %target_sbomfile_full% --sort-keys > 2_%target_sbomfile%.json cat 2_%target_sbomfile%.json | jq "[.packages[] | {name:.name} | flatten[]] | unique" > 3_%target_sbomfile%.txt
$ generator your-spdx-sbom-file.json $ dir /b 2_your-spdx-sbom-file.json 3_your-spdx-sbom-file.txt your-spdx-sbom-file.json