Is there a way to programmatically elevate a process as needed? I am looking for functionality like how Windows Task Manager has the UAC shield on the button and gives a UAC prompt after clicking on the "Show processes from all users" button.
#RequireAdmin elevates the process right when the script is initialized, but sometimes programs don't always need elevation (such as Task Manager without looking at all users processes) and that brings unnecessary UAC prompts.
Basically, I have a pro