I am trying to run a powershell script to upgrade enterprise software. However since if someone singed-in to the computer it is hard to find time to run this script. Therefore, I have make the script to wait until user logged-out.
I know how to find out if someone is logged into the pc. I need to know how to make powershell script wait until the user logged out.