So I'm trying to better automate my update process in SCCM 2012 R2 SP1. Right now I have an ADR that runs in the evening on Patch Tuesday that finds the appropriate updates based on update classification, product, date, not expired or superseded. It downloads the updates it finds into the Deployment Package, creates a new SUG for the month and deploys it out to the first pilot group. Then the next morning I come in and change the name of the SUG and the deployment to meet the naming standard, deploy it out to the remaining pilot and prod groups and email the end users affected in each group. I know I can use powershell to automate the deployment to the additional groups that I currently do manually. I could probably even automate the renames and the email notifications.
The question I have not been able to find an answer for though is can I script what the ADR is doing with powershell? Can I script out finding the appropriate updates based on the search criteria (product, classification, date, etc) and create a SUG and do all of this all in one self contained PS script setup as a scheduled task? I've looked through the PS cmdlets but have not found a way to search for the applicable updates based on the criteria like i can in the ADR wizard.