I'm creating a Windows VM in azure and want to execute a Powershell script to perform the following tasks:
- install SCCM client
- reboot, and SCCM task sequence will start in a few minutes.
- wait for the task sequence completes
- extra task 1
- extra task 2 ....
My problem is, during the waiting time in step 3, how to check if the task sequence is completed using Powershell and CIM class/WMI?
The apps being installed is a device collection and I don't login to the machine.