The WaitForFile.-Command has a lot of options