Sunday, May 2, 2010

Highlight PowerShell in red when running as Administrator

If you have the PowerShell Community Extensions installed, you can load your profile for editing by running notepad $profile or ep.

Paste the code from this blog into your profile:
& {
    $prp=new-object System.Security.Principal.WindowsPrincipal($wid)
    if ($IsAdmin)

If you are running all users as standard users (which you should really be doing, see why here), there is no need to use this script. Simply put the following code into the Administrator profile:


Post a Comment