Basically we need to figure out how to tweak our .\start.ps1 on our windows images such that they can intercept the various EXIT, INT and TERM events and execute .\config.ps1 to remove the ADO pools.. otherwise they keep piling up and appear idle in ADO and we have to go in and manually delete them.
We started using this: https://techcommunity.microsoft.com/t5/fasttrack-for-azure/leveraging-keda-to-scale-azure-devops-agents-efficiently/ba-p/3720284 to create our docker file and start-scripts, but we don't know the equivalent powershell commands for the bash 'trap' statements.