Ok, this is a little more difficult than the title makes it out to be.
I know $env:username will get me the user.
Unfortunately, that's not the user I want to get when I'm in an elevated ps window.
Basically I am using a logon script that starts a powershell process as another user.
Now here's the two questions I have:
1. Can I get the username prior to starting the elevated prompt and pass it to the elevated prompt? If so how?
2. Once in the elevated prompt, can I some how pull the user that logged on rather than who the user is in the elevated prompt? Again, if so, how?