Nested packages are one of my favorite features. The ability to add an entire package as a step within any number of other packages has many benefits, such as source control and the ease of maintaining baseline packages for different types of users in your organization. It likely isn’t often that the question will arise, but just how do you determine where a specific package is nested?
How to view where packages are nested through the console
The PDQ Deploy console itself offers some visibility into where a given package is nested, but it’s far from a perfect feature. Quite helpful if a package is only nested in a single location, but less so if that package is nested in multiple locations.
The “Nested Within” details may be found in the Properties > Options tab of a package that is nested.
For a single nested location, you’ll see the path to the nested location:
If the same package is instead nested in multiple locations, you’ll see only the number of packages it is nested in:
Time to query that database
You may be saying, “But Andrew, I want to actually see where my package is nested, not just the number locations.” For this step, we’ll need to query the SQLite database with an assist from the most powerful of shells, PowerShell. Make sure to run the below query elevated on the PDQ server and replace ‘PackageTitle’ with that of your own.
sqlite3.exe "C:\ProgramData\Admin Arsenal\PDQ Deploy\Database.db" "SELECT Path FROM Packages WHERE PackageDefinitionId in(SELECT PackageDefinitionId FROM PackageSteps WHERE Title = 'PackageTitle')"
As I mentioned earlier, there’s definitely room for improvement for how this is displayed in the console in order to avoid the database query entirely. Personally, I imagine them all being listed as clickable links to jump to the parent package, but until then, happy querying.