Is there a way to elevate a PowerShell Studio built .EXE and get those same credentials (used to elevate) into a PScredential object for use within the script?
I currently have a project that needs to run elevated, but it also requires the credentials for some futher operations. I am currently embedding the manifest for elevation (which, in practice, is prompting the (standard) users for "admin" creds) and then I have to prompt for the ("admin") password again in order to have those credentials available within the script.
The only other way I can think to do this is to create a small ("launcher") exe that takes in the creds, launches the actual exe elevated - using something like ........
- Start-Process powershell.exe -Credential $cred -WindowStyle Hidden -Args '-noprofile', '-command', "Start-Process 'D:\psGUI.exe' -Verb RunAs"
Is there a better, more elegant, way to this?
Thanks
Product: PowerShell Studio 2020 (64 Bit)
Build: v5.7.182
OS: Windows 7 Professional (64 Bit)
Build: v6.1.7601.65536