To find out the time of the program or process in windows?

I'm trying to write a script that, when assigned an application name or process in Windows, returns the time it was used since it was installed, but I can not find anything using batch or power shell and not even anything. in python.
I know that there is a method that keeps track of active windows and shows the time this window was active, but the time of operation even before the script is executed for the first time.
and I'm writing a portable script that is used in a larger project, so I can not use third-party applications
Can someone help me?