Run a LINQPad script as Administrator (eleveated)
Some code requires higher privileges. Sure you can run LINQPad itself as Administrator - but then access to e.g. network share might not work and it is better to limit the higher access rights to just the execution of a single script. So an option for a query "Requires Administrative Privileges" would be great. Values: true, false. Maybe an addtional optional would be: Always ask for Administrator priviledges (that is: on every execution elevate again) or "Ask only once". Then only the first execution would request elevation. Further executions would run automatically in an already elevate security context. Also a general feature "Run As..." would be great. Again "Run As..." is built in into Windows and you can run multiple instances of LINQPad - but for easier usage storing that information as a property of the query would be helpful.
Thanks for your support and creating the most valuable tool currently available for the Windows environment.

This feature is available from version 6.8. Add ‘#LINQPad admin’ to the top of your query.
-
Eli Markov commented
Adding #LINQPad admin is nice, but it starts the whole LinqPad elevated which means that I lose all my extensions and nugets...
It would be better (if possible) to run the LINQPad6.Query, associated with the current script, elevated.