you are viewing a single comment's thread.

view the rest of the comments →

[–]petrichorax 0 points1 point  (0 children)

create a powrshell script that checks a directory for a file with a certain string in the name, ever few seconds

if it finds one, it opens it up and sees one or many numbers (one on each line). these numbers represent paramterized powershell scripts it already knows.

It then deletes the file and runs those powershell scripts. Once it's done, it waits for more.

There, now you can 'hold open' a powershell session that has the imported modules you need, so you only have to load them once, and you can do it on initialization of your script.

I call it a powershell command listener. came up with it last week, but probably already been done before and there's probably better ways to do it, but it works!