Hi jpreston

If you post code, please use the ‘Insert Code’ button. Please and thank you!

codebutton_small.png

So your code needs a little rejigging, you need to loop lookign for the process - when it disapears then the logoff is triggered not sure why you are executing chrome.exe /terminate in this context as it doesn’t appear to be a valid switch (see: List of Chromium Command Line Switches « Peter Beverloo: https://peter.sh/experiments/chromium-command-line-switches/ )

#shell.ps1
& 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' -d5000 www.msdsonline.com
sleep -s 15
while(get-process "Chrome"){
sleep -s 10
# & 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' /terminate
}
logoff.exe