We’ve set out to help a customer with automation within their IT department.
By creating scripts and cmdlets the Helpdesk-team frequently occurring tedious tasks.

Some tasks requires an elevated prompt, there is no way around it. But it’s not obvious how to check if the current prompt is elevated, or how to elevate the session.

You can run this block to check if the current session is elevated.

By running this one-liner you can elevate the a PowerShell session.

Normal session
Elevated session