system center configuration manager PowerShell stuff
Initiate Configuration Manager Client Scan and wait for it to finish
Invoke-ConfigurationManagerCycle -CycleName 'Software Update Scan Cycle'
Running Software Update Scan Cycle
Completed
Thanks to:
http://mickitblog.blogspot.co.il/2016/05/initiating-sccm-actions-with.html
https://blogs.msdn.microsoft.com/timid/2013/03/01/psh-v1-get-tail/
https://www.systemcenterdudes.com/configuration-manager-2012-client-command-list/
Just fork and send pull requests, Thank you!