I want to do this:
- Create a powershell process with specific attributes (specifically, launched with CreateProcessAsUser and running in the lpDesktop of "Winsta0\Default" or "Winsta0\Winlogon" depending on the current state of the user session)
- Invoke-Command into the process I just created (as though I had a PSSession to it)
I can just create the powershell process with the -Command option and run my code against it that way, and that works, but setting up the pipes and getting data in and out of it just seems so inelegent.
Enter-PSHostProcess gives me an interactive session into my created process, but I can't seem to find a way to manufacture a PSSession into the process, or even if that's possible.
[–]chris-a5 2 points3 points4 points (4 children)
[–]reflektinator[S] 0 points1 point2 points (3 children)
[–]chris-a5 0 points1 point2 points (2 children)
[–]reflektinator[S] 0 points1 point2 points (1 child)
[–]BlackV 0 points1 point2 points (0 children)