I'm building a PoSh startup script that initializes a couple scheduled tasks. One task is triggered at user logon and another is triggered on idle. Both tasks run the script again. Only the first part of the script is needed at startup, but the entire script should run all other times.
How might a script determine when it is running at startup vs running at later times?