Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##############################
- #.SYNOPSIS
- # Launches new PowerShell with elevated permissions
- #
- #.DESCRIPTION
- # Launches new PowerShell with elevated permissions which is handy for when you find yourself in a normal prompt
- # and realise you should have been running as admin, a slight work around for the lack of SUDO
- #
- #.EXAMPLE
- # Start-PowerShellAsAdmin
- #
- #.NOTES
- # Add this to your PowerShell profile ($profile) to ensure its always available
- # Doesn't set the location, yet..
- ##############################
- Function Start-PowerShellAsAdmin() {
- Start-Process PowerShell -Verb RunAs
- }
- # Create an alias for a more command friendly experience
- Set-Alias -Name psadmin -value Start-PowerShellAsAdmin
Add Comment
Please, Sign In to add comment