pass Keystroke to powershell in background, started with -w hidden

pass Keystroke to powershell in background, started with -w hidden

I am trying to learn powershell scripting and I have the following problem:

A script needs to get a ENTER keystroke during its runtime so the first lines are executed before the 2nd part starts. The script is started with "powershell -w hidden script.ps1" so it is running in background with no window visible.

How can I achieve that? I did not find an answer that I can understand. Is it possible to write a keystroke in the script somehow?

相关内容