My Software Notes

Useful things I discover

Launch a Powershell console with Administrator rights from a Powershell console without Administrator rights

leave a comment »

That title is a mouthfull, but the good news is that the Powershell command to do it takes less characters.

It’s really simple once you have hunted around on the net for a while:

Start-Process "$psHome\powershell.exe" -Verb Runas

That’s it.

Open a regular PS console and type that.

I’ve only tried it on my own machine where I am an admin and I have UAC turned on. When I try it I get the UAC prompt, followed by a nice PS admin console.

I got it from this: Re-launch Powershell Script Elevated

—-

This is bad, but I couldn’t resist it.  I’m a big fan of “Young Frankenstein“, one of the funniest movies of all time,  and there is a joke in it about “elevate me” (go to this page and search for “elevate”), so I created the “Elevate-Me” function:

function Elevate-Me ()
{
    echo "Inga:            ""Now? Right here?"""
    echo "Dr Frankenstein: ""Yes, yes.  Raise the platform"""
    echo "Inga:            ""Oh. Ze platform. Oh, zat, yah, yah ... yes"""
    Start-Process "$psHome\powershell.exe" -Verb Runas
}

Just add it to your profile and let the elevating begin 🙂

BTW: I know “Elevate” is not an approved verb, but it’s worth it for the homage to the brilliance of Mel & Gene (and Teri).

—–

Advertisements

Written by gsdwriter

April 20, 2012 at 8:00 am

Posted in Humor, Powershell, Tools

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: