Hello,
In this post, I will share a script to identify which SCCM Task Sequences include specific SCCM Packages.
Let’s say we have several packages that we would like to delete, but we’re unsure whether these packages are utilized in any task sequences. Therefore, we want to ensure that none of the task sequences are using them.
Download the script from the link below.
https://github.com/gokhanyildan/SCCMScripts/blob/main/SCCMTS-PackageFinder.ps1
We have some packages we would like to delete.

First, we can create a CSV file containing the Package IDs of all the packages we want to check.

You will need to edit the following variables in the script (highlighted in yellow):
$SiteCode
$csvPath
$results

When you run the script, it will list all the task sequences where the specified packages are used.

Thanks.
Note:
I developed this script with the help of DeepSeek. While I have tested it numerous times, use it at your own risk.